From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0001.html From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0002.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0003.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0001.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0004.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0002.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0005.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0003.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0006.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0004.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0008.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0006.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0009.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0007.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0010.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0008.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0011.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0009.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0012.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0010.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0013.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0011.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0014.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0012.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0015.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0013.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0016.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0014.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0001.html From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0017.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0015.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0002.html From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0018.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0016.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0003.html From pboulton at pulsetracer.com Fri Apr 18 14:30:13 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Fri, 18 Apr 2008 13:30:13 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site Message-ID: <480904D5.1060307@pulsetracer.com> Hello, gentle serial porters. I have downloaded the zipped up binaries for use on Windows without Sun's CommAPI, but don't seem able to extract anything from the download. Go to main page, http://www.rxtx.org/ Click on Downloads I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) And I save it to disk. If I try and extract the files with WinZip, Winzip thinks the archive is corrupt. If I try using Windows Explorer, I am able to extract it into a single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than the original .zip. Any help would be much appreciated. Sincerely, Philip Boulton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080418/97d89793/attachment.html From tjarvi at qbang.org Fri Apr 18 19:07:00 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 18 Apr 2008 19:07:00 -0600 (MDT) Subject: [Rxtx] Difficulty opening zip file at rxtx site In-Reply-To: <480904D5.1060307@pulsetracer.com> References: <480904D5.1060307@pulsetracer.com> Message-ID: On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0019.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0017.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0004.html From pboulton at pulsetracer.com Fri Apr 18 14:30:13 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Fri, 18 Apr 2008 13:30:13 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site Message-ID: <480904D5.1060307@pulsetracer.com> Hello, gentle serial porters. I have downloaded the zipped up binaries for use on Windows without Sun's CommAPI, but don't seem able to extract anything from the download. Go to main page, http://www.rxtx.org/ Click on Downloads I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) And I save it to disk. If I try and extract the files with WinZip, Winzip thinks the archive is corrupt. If I try using Windows Explorer, I am able to extract it into a single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than the original .zip. Any help would be much appreciated. Sincerely, Philip Boulton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080418/97d89793/attachment-0001.html From tjarvi at qbang.org Fri Apr 18 19:07:00 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 18 Apr 2008 19:07:00 -0600 (MDT) Subject: [Rxtx] Difficulty opening zip file at rxtx site In-Reply-To: <480904D5.1060307@pulsetracer.com> References: <480904D5.1060307@pulsetracer.com> Message-ID: On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org From pboulton at pulsetracer.com Sat Apr 19 12:46:26 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Sat, 19 Apr 2008 11:46:26 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site References: <480904D5.1060307@pulsetracer.com> Message-ID: <53DB7576450695419E09299104043761A78533@ZTGSERVER.ztg.local> I have been able to get my hands on the binaries, by going to the ftp directory /pub/rxtx at ftp.qbang.org,, and ftping the file rxtx-2.1-7-bins-r2.zip . This opens happily with Winzip, and extracts as the set of files that you describe below. I only experience the ill-formed archive problem by clicking the link on the rxtx.org Downloads page (http://rxtx.qbang.org/pub/rxtx/ rxtx-2.1-7-bins-r2.zip ). Not sure what to make of that. Philip Boulton ________________________________ From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Fri 4/18/2008 6:07 PM To: Philip Boulton Cc: rxtx at qbang.org Subject: Re: [Rxtx] Difficulty opening zip file at rxtx site On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080419/147923bb/attachment.html From jlar310 at gmail.com Sat Apr 19 19:11:55 2008 From: jlar310 at gmail.com (Jeff Larsen) Date: Sat, 19 Apr 2008 20:11:55 -0500 Subject: [Rxtx] Moxa serial over Ethernet driver Message-ID: Hi all, I've been using javax.comm for years to communicate with a legacy radio data system. We want to migrate the java side of the system to a VMware Server virtual machine. We've had great success using Moxa DE-303 and 5610 serial over Ethernet appliances and virtual machines for running hylafax. The OS (Linux in this case) uses a kernel driver to communicate with the Moxa via a virtual serial port such as /dev/ttyr00. I want to do the same thing with javax.comm or gnu.io to connect to a virtual serial port. However I'm hitting road blocks everywhere. javax.comm for Linux sees the virtual port, but there are transmission errors. Tried Solaris too, but the Solaris Moxa drivers don't play nice with javax.comm because the driver uses /dev/pts/n instead of /dev/term/x. Next I tried RXTX on Linux, but I'm getting NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX on Solaris. Has anyone used RXTX with serial over Ethernet devices? Any hints on how to make it work? I know that I'm not completely off track because javax.comm does work with Moxa on a Windows platform, but that's just not an option for production deployment. -- Jeff From tjarvi at qbang.org Sat Apr 19 21:08:41 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 19 Apr 2008 21:08:41 -0600 (MDT) Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: yOn Sat, 19 Apr 2008, Jeff Larsen wrote: > Hi all, > > I've been using javax.comm for years to communicate with a legacy > radio data system. We want to migrate the java side of the system to a > VMware Server virtual machine. We've had great success using Moxa > DE-303 and 5610 serial over Ethernet appliances and virtual machines > for running hylafax. The OS (Linux in this case) uses a kernel driver > to communicate with the Moxa via a virtual serial port such as > /dev/ttyr00. > > I want to do the same thing with javax.comm or gnu.io to connect to a > virtual serial port. However I'm hitting road blocks everywhere. > javax.comm for Linux sees the virtual port, but there are transmission > errors. Tried Solaris too, but the Solaris Moxa drivers don't play > nice with javax.comm because the driver uses /dev/pts/n instead of > /dev/term/x. Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris. > > Has anyone used RXTX with serial over Ethernet devices? Any hints on > how to make it work? > > I know that I'm not completely off track because javax.comm does work > with Moxa on a Windows platform, but that's just not an option for > production deployment. > > Moxa should work under linux. There may be minor issues depending upon how complete the kernel driver is but I think it will work. One of the minor issues is /dev/ttyr00 is not enumerated. There are several work arounds documented with the source code and on the wiki. The easiest solution for testing purposes is to make a symbolic link from /dev/ttyr00 to a port that is enumerated such as /dev/ttyS129. You can later alter the rxtx source or use properties to change the enumerated ports. -- Trent Jarvi tjarvi at qbang.org From d.tonhofer at m-plify.com Sun Apr 20 03:33:30 2008 From: d.tonhofer at m-plify.com (David Tonhofer (M-PLIFY S.A.)) Date: Sun, 20 Apr 2008 11:33:30 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: <480B0DEA.5010908@m-plify.com> Jeff Larsen wrote: > Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris It might be that the Java side of RXTX does not recognize that portname. Trying modifying src/RXTXCommDriver.java as described in this case: http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0020.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0018.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0005.html From pboulton at pulsetracer.com Fri Apr 18 14:30:13 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Fri, 18 Apr 2008 13:30:13 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site Message-ID: <480904D5.1060307@pulsetracer.com> Hello, gentle serial porters. I have downloaded the zipped up binaries for use on Windows without Sun's CommAPI, but don't seem able to extract anything from the download. Go to main page, http://www.rxtx.org/ Click on Downloads I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) And I save it to disk. If I try and extract the files with WinZip, Winzip thinks the archive is corrupt. If I try using Windows Explorer, I am able to extract it into a single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than the original .zip. Any help would be much appreciated. Sincerely, Philip Boulton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080418/97d89793/attachment-0002.html From tjarvi at qbang.org Fri Apr 18 19:07:00 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 18 Apr 2008 19:07:00 -0600 (MDT) Subject: [Rxtx] Difficulty opening zip file at rxtx site In-Reply-To: <480904D5.1060307@pulsetracer.com> References: <480904D5.1060307@pulsetracer.com> Message-ID: On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org From pboulton at pulsetracer.com Sat Apr 19 12:46:26 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Sat, 19 Apr 2008 11:46:26 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site References: <480904D5.1060307@pulsetracer.com> Message-ID: <53DB7576450695419E09299104043761A78533@ZTGSERVER.ztg.local> I have been able to get my hands on the binaries, by going to the ftp directory /pub/rxtx at ftp.qbang.org,, and ftping the file rxtx-2.1-7-bins-r2.zip . This opens happily with Winzip, and extracts as the set of files that you describe below. I only experience the ill-formed archive problem by clicking the link on the rxtx.org Downloads page (http://rxtx.qbang.org/pub/rxtx/ rxtx-2.1-7-bins-r2.zip ). Not sure what to make of that. Philip Boulton ________________________________ From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Fri 4/18/2008 6:07 PM To: Philip Boulton Cc: rxtx at qbang.org Subject: Re: [Rxtx] Difficulty opening zip file at rxtx site On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080419/147923bb/attachment-0001.html From jlar310 at gmail.com Sat Apr 19 19:11:55 2008 From: jlar310 at gmail.com (Jeff Larsen) Date: Sat, 19 Apr 2008 20:11:55 -0500 Subject: [Rxtx] Moxa serial over Ethernet driver Message-ID: Hi all, I've been using javax.comm for years to communicate with a legacy radio data system. We want to migrate the java side of the system to a VMware Server virtual machine. We've had great success using Moxa DE-303 and 5610 serial over Ethernet appliances and virtual machines for running hylafax. The OS (Linux in this case) uses a kernel driver to communicate with the Moxa via a virtual serial port such as /dev/ttyr00. I want to do the same thing with javax.comm or gnu.io to connect to a virtual serial port. However I'm hitting road blocks everywhere. javax.comm for Linux sees the virtual port, but there are transmission errors. Tried Solaris too, but the Solaris Moxa drivers don't play nice with javax.comm because the driver uses /dev/pts/n instead of /dev/term/x. Next I tried RXTX on Linux, but I'm getting NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX on Solaris. Has anyone used RXTX with serial over Ethernet devices? Any hints on how to make it work? I know that I'm not completely off track because javax.comm does work with Moxa on a Windows platform, but that's just not an option for production deployment. -- Jeff From tjarvi at qbang.org Sat Apr 19 21:08:41 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 19 Apr 2008 21:08:41 -0600 (MDT) Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: yOn Sat, 19 Apr 2008, Jeff Larsen wrote: > Hi all, > > I've been using javax.comm for years to communicate with a legacy > radio data system. We want to migrate the java side of the system to a > VMware Server virtual machine. We've had great success using Moxa > DE-303 and 5610 serial over Ethernet appliances and virtual machines > for running hylafax. The OS (Linux in this case) uses a kernel driver > to communicate with the Moxa via a virtual serial port such as > /dev/ttyr00. > > I want to do the same thing with javax.comm or gnu.io to connect to a > virtual serial port. However I'm hitting road blocks everywhere. > javax.comm for Linux sees the virtual port, but there are transmission > errors. Tried Solaris too, but the Solaris Moxa drivers don't play > nice with javax.comm because the driver uses /dev/pts/n instead of > /dev/term/x. Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris. > > Has anyone used RXTX with serial over Ethernet devices? Any hints on > how to make it work? > > I know that I'm not completely off track because javax.comm does work > with Moxa on a Windows platform, but that's just not an option for > production deployment. > > Moxa should work under linux. There may be minor issues depending upon how complete the kernel driver is but I think it will work. One of the minor issues is /dev/ttyr00 is not enumerated. There are several work arounds documented with the source code and on the wiki. The easiest solution for testing purposes is to make a symbolic link from /dev/ttyr00 to a port that is enumerated such as /dev/ttyS129. You can later alter the rxtx source or use properties to change the enumerated ports. -- Trent Jarvi tjarvi at qbang.org From d.tonhofer at m-plify.com Sun Apr 20 03:33:30 2008 From: d.tonhofer at m-plify.com (David Tonhofer (M-PLIFY S.A.)) Date: Sun, 20 Apr 2008 11:33:30 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: <480B0DEA.5010908@m-plify.com> Jeff Larsen wrote: > Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris It might be that the Java side of RXTX does not recognize that portname. Trying modifying src/RXTXCommDriver.java as described in this case: http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card From ajmas at sympatico.ca Sun Apr 20 16:37:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Apr 2008 18:37:59 -0400 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <480B0DEA.5010908@m-plify.com> References: <480B0DEA.5010908@m-plify.com> Message-ID: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > Jeff Larsen wrote: >> Next I tried RXTX on Linux, but I'm getting >> NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX >> on Solaris > It might be that the Java side of RXTX does not recognize that > portname. > Trying modifying src/RXTXCommDriver.java as described in this case: > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card I wonder whether it would be worth allowing custom port prefixes as a system parameter? For example: gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" Andre From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0021.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0019.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0006.html From pboulton at pulsetracer.com Fri Apr 18 14:30:13 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Fri, 18 Apr 2008 13:30:13 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site Message-ID: <480904D5.1060307@pulsetracer.com> Hello, gentle serial porters. I have downloaded the zipped up binaries for use on Windows without Sun's CommAPI, but don't seem able to extract anything from the download. Go to main page, http://www.rxtx.org/ Click on Downloads I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) And I save it to disk. If I try and extract the files with WinZip, Winzip thinks the archive is corrupt. If I try using Windows Explorer, I am able to extract it into a single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than the original .zip. Any help would be much appreciated. Sincerely, Philip Boulton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080418/97d89793/attachment-0004.html From tjarvi at qbang.org Fri Apr 18 19:07:00 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 18 Apr 2008 19:07:00 -0600 (MDT) Subject: [Rxtx] Difficulty opening zip file at rxtx site In-Reply-To: <480904D5.1060307@pulsetracer.com> References: <480904D5.1060307@pulsetracer.com> Message-ID: On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org From pboulton at pulsetracer.com Sat Apr 19 12:46:26 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Sat, 19 Apr 2008 11:46:26 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site References: <480904D5.1060307@pulsetracer.com> Message-ID: <53DB7576450695419E09299104043761A78533@ZTGSERVER.ztg.local> I have been able to get my hands on the binaries, by going to the ftp directory /pub/rxtx at ftp.qbang.org,, and ftping the file rxtx-2.1-7-bins-r2.zip . This opens happily with Winzip, and extracts as the set of files that you describe below. I only experience the ill-formed archive problem by clicking the link on the rxtx.org Downloads page (http://rxtx.qbang.org/pub/rxtx/ rxtx-2.1-7-bins-r2.zip ). Not sure what to make of that. Philip Boulton ________________________________ From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Fri 4/18/2008 6:07 PM To: Philip Boulton Cc: rxtx at qbang.org Subject: Re: [Rxtx] Difficulty opening zip file at rxtx site On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080419/147923bb/attachment-0003.html From jlar310 at gmail.com Sat Apr 19 19:11:55 2008 From: jlar310 at gmail.com (Jeff Larsen) Date: Sat, 19 Apr 2008 20:11:55 -0500 Subject: [Rxtx] Moxa serial over Ethernet driver Message-ID: Hi all, I've been using javax.comm for years to communicate with a legacy radio data system. We want to migrate the java side of the system to a VMware Server virtual machine. We've had great success using Moxa DE-303 and 5610 serial over Ethernet appliances and virtual machines for running hylafax. The OS (Linux in this case) uses a kernel driver to communicate with the Moxa via a virtual serial port such as /dev/ttyr00. I want to do the same thing with javax.comm or gnu.io to connect to a virtual serial port. However I'm hitting road blocks everywhere. javax.comm for Linux sees the virtual port, but there are transmission errors. Tried Solaris too, but the Solaris Moxa drivers don't play nice with javax.comm because the driver uses /dev/pts/n instead of /dev/term/x. Next I tried RXTX on Linux, but I'm getting NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX on Solaris. Has anyone used RXTX with serial over Ethernet devices? Any hints on how to make it work? I know that I'm not completely off track because javax.comm does work with Moxa on a Windows platform, but that's just not an option for production deployment. -- Jeff From tjarvi at qbang.org Sat Apr 19 21:08:41 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 19 Apr 2008 21:08:41 -0600 (MDT) Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: yOn Sat, 19 Apr 2008, Jeff Larsen wrote: > Hi all, > > I've been using javax.comm for years to communicate with a legacy > radio data system. We want to migrate the java side of the system to a > VMware Server virtual machine. We've had great success using Moxa > DE-303 and 5610 serial over Ethernet appliances and virtual machines > for running hylafax. The OS (Linux in this case) uses a kernel driver > to communicate with the Moxa via a virtual serial port such as > /dev/ttyr00. > > I want to do the same thing with javax.comm or gnu.io to connect to a > virtual serial port. However I'm hitting road blocks everywhere. > javax.comm for Linux sees the virtual port, but there are transmission > errors. Tried Solaris too, but the Solaris Moxa drivers don't play > nice with javax.comm because the driver uses /dev/pts/n instead of > /dev/term/x. Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris. > > Has anyone used RXTX with serial over Ethernet devices? Any hints on > how to make it work? > > I know that I'm not completely off track because javax.comm does work > with Moxa on a Windows platform, but that's just not an option for > production deployment. > > Moxa should work under linux. There may be minor issues depending upon how complete the kernel driver is but I think it will work. One of the minor issues is /dev/ttyr00 is not enumerated. There are several work arounds documented with the source code and on the wiki. The easiest solution for testing purposes is to make a symbolic link from /dev/ttyr00 to a port that is enumerated such as /dev/ttyS129. You can later alter the rxtx source or use properties to change the enumerated ports. -- Trent Jarvi tjarvi at qbang.org From d.tonhofer at m-plify.com Sun Apr 20 03:33:30 2008 From: d.tonhofer at m-plify.com (David Tonhofer (M-PLIFY S.A.)) Date: Sun, 20 Apr 2008 11:33:30 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: <480B0DEA.5010908@m-plify.com> Jeff Larsen wrote: > Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris It might be that the Java side of RXTX does not recognize that portname. Trying modifying src/RXTXCommDriver.java as described in this case: http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card From ajmas at sympatico.ca Sun Apr 20 16:37:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Apr 2008 18:37:59 -0400 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <480B0DEA.5010908@m-plify.com> References: <480B0DEA.5010908@m-plify.com> Message-ID: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > Jeff Larsen wrote: >> Next I tried RXTX on Linux, but I'm getting >> NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX >> on Solaris > It might be that the Java side of RXTX does not recognize that > portname. > Trying modifying src/RXTXCommDriver.java as described in this case: > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card I wonder whether it would be worth allowing custom port prefixes as a system parameter? For example: gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" Andre From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0022.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0020.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0007.html From pboulton at pulsetracer.com Fri Apr 18 14:30:13 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Fri, 18 Apr 2008 13:30:13 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site Message-ID: <480904D5.1060307@pulsetracer.com> Hello, gentle serial porters. I have downloaded the zipped up binaries for use on Windows without Sun's CommAPI, but don't seem able to extract anything from the download. Go to main page, http://www.rxtx.org/ Click on Downloads I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) And I save it to disk. If I try and extract the files with WinZip, Winzip thinks the archive is corrupt. If I try using Windows Explorer, I am able to extract it into a single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than the original .zip. Any help would be much appreciated. Sincerely, Philip Boulton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080418/97d89793/attachment-0005.html From tjarvi at qbang.org Fri Apr 18 19:07:00 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 18 Apr 2008 19:07:00 -0600 (MDT) Subject: [Rxtx] Difficulty opening zip file at rxtx site In-Reply-To: <480904D5.1060307@pulsetracer.com> References: <480904D5.1060307@pulsetracer.com> Message-ID: On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org From pboulton at pulsetracer.com Sat Apr 19 12:46:26 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Sat, 19 Apr 2008 11:46:26 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site References: <480904D5.1060307@pulsetracer.com> Message-ID: <53DB7576450695419E09299104043761A78533@ZTGSERVER.ztg.local> I have been able to get my hands on the binaries, by going to the ftp directory /pub/rxtx at ftp.qbang.org,, and ftping the file rxtx-2.1-7-bins-r2.zip . This opens happily with Winzip, and extracts as the set of files that you describe below. I only experience the ill-formed archive problem by clicking the link on the rxtx.org Downloads page (http://rxtx.qbang.org/pub/rxtx/ rxtx-2.1-7-bins-r2.zip ). Not sure what to make of that. Philip Boulton ________________________________ From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Fri 4/18/2008 6:07 PM To: Philip Boulton Cc: rxtx at qbang.org Subject: Re: [Rxtx] Difficulty opening zip file at rxtx site On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080419/147923bb/attachment-0004.html From jlar310 at gmail.com Sat Apr 19 19:11:55 2008 From: jlar310 at gmail.com (Jeff Larsen) Date: Sat, 19 Apr 2008 20:11:55 -0500 Subject: [Rxtx] Moxa serial over Ethernet driver Message-ID: Hi all, I've been using javax.comm for years to communicate with a legacy radio data system. We want to migrate the java side of the system to a VMware Server virtual machine. We've had great success using Moxa DE-303 and 5610 serial over Ethernet appliances and virtual machines for running hylafax. The OS (Linux in this case) uses a kernel driver to communicate with the Moxa via a virtual serial port such as /dev/ttyr00. I want to do the same thing with javax.comm or gnu.io to connect to a virtual serial port. However I'm hitting road blocks everywhere. javax.comm for Linux sees the virtual port, but there are transmission errors. Tried Solaris too, but the Solaris Moxa drivers don't play nice with javax.comm because the driver uses /dev/pts/n instead of /dev/term/x. Next I tried RXTX on Linux, but I'm getting NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX on Solaris. Has anyone used RXTX with serial over Ethernet devices? Any hints on how to make it work? I know that I'm not completely off track because javax.comm does work with Moxa on a Windows platform, but that's just not an option for production deployment. -- Jeff From tjarvi at qbang.org Sat Apr 19 21:08:41 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 19 Apr 2008 21:08:41 -0600 (MDT) Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: yOn Sat, 19 Apr 2008, Jeff Larsen wrote: > Hi all, > > I've been using javax.comm for years to communicate with a legacy > radio data system. We want to migrate the java side of the system to a > VMware Server virtual machine. We've had great success using Moxa > DE-303 and 5610 serial over Ethernet appliances and virtual machines > for running hylafax. The OS (Linux in this case) uses a kernel driver > to communicate with the Moxa via a virtual serial port such as > /dev/ttyr00. > > I want to do the same thing with javax.comm or gnu.io to connect to a > virtual serial port. However I'm hitting road blocks everywhere. > javax.comm for Linux sees the virtual port, but there are transmission > errors. Tried Solaris too, but the Solaris Moxa drivers don't play > nice with javax.comm because the driver uses /dev/pts/n instead of > /dev/term/x. Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris. > > Has anyone used RXTX with serial over Ethernet devices? Any hints on > how to make it work? > > I know that I'm not completely off track because javax.comm does work > with Moxa on a Windows platform, but that's just not an option for > production deployment. > > Moxa should work under linux. There may be minor issues depending upon how complete the kernel driver is but I think it will work. One of the minor issues is /dev/ttyr00 is not enumerated. There are several work arounds documented with the source code and on the wiki. The easiest solution for testing purposes is to make a symbolic link from /dev/ttyr00 to a port that is enumerated such as /dev/ttyS129. You can later alter the rxtx source or use properties to change the enumerated ports. -- Trent Jarvi tjarvi at qbang.org From d.tonhofer at m-plify.com Sun Apr 20 03:33:30 2008 From: d.tonhofer at m-plify.com (David Tonhofer (M-PLIFY S.A.)) Date: Sun, 20 Apr 2008 11:33:30 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: <480B0DEA.5010908@m-plify.com> Jeff Larsen wrote: > Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris It might be that the Java side of RXTX does not recognize that portname. Trying modifying src/RXTXCommDriver.java as described in this case: http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card From ajmas at sympatico.ca Sun Apr 20 16:37:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Apr 2008 18:37:59 -0400 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <480B0DEA.5010908@m-plify.com> References: <480B0DEA.5010908@m-plify.com> Message-ID: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > Jeff Larsen wrote: >> Next I tried RXTX on Linux, but I'm getting >> NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX >> on Solaris > It might be that the Java side of RXTX does not recognize that > portname. > Trying modifying src/RXTXCommDriver.java as described in this case: > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card I wonder whether it would be worth allowing custom port prefixes as a system parameter? For example: gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" Andre From Martin.Oberhuber at windriver.com Tue Apr 22 12:34:36 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 22 Apr 2008 20:34:36 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> References: <480B0DEA.5010908@m-plify.com> <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE6485848056CD6CE@ism-mail03.corp.ad.wrs.com> Sounds like a great idea... I'm wondering how the "variable part" after the Prefixes could be specified though? What about allowing Regular Expression character Classes in the existing System Property for specifying ports: System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyS[0-9],ttyS[ABC],ttyUSB[0-9a-z]"); The set of allowed patterns would of course need to Be restricted compared to REGEX, because it must be A syntax that supports iterating over it. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Montag, 21. April 2008 00:38 > To: rxtx at qbang.org and Users > Subject: Re: [Rxtx] Moxa serial over Ethernet driver > > > On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > > Jeff Larsen wrote: > >> Next I tried RXTX on Linux, but I'm getting > >> NoSuchPortException connecting to /dev/ttyr00. I have yet > to try RXTX > >> on Solaris > > It might be that the Java side of RXTX does not recognize that > > portname. > > Trying modifying src/RXTXCommDriver.java as described in this case: > > > > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_ > SST-4P.2FLP_multiport_card > > I wonder whether it would be worth allowing custom port > prefixes as a > system parameter? For > example: > > gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Loi.TRAN at weatherford.com Tue Apr 22 13:10:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Tue, 22 Apr 2008 14:10:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled Message-ID: Hi, I'm currently using the Java RXTX API to interface to a serial port. The serial port is connected to a bridge board that communicates with our communications system running at 1.875 Mbps which is linked to an embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no flow control). I send a command to the embedded board through the serial-bridge board which then is relayed to the embedded board. The command sent asks the embedded board to dump a binary image. Here's where I'm hitting some problems. I've successfully done this is an integrated serial port from the laptop. The binary file that comes back is consistent on every attempt. When I use the application I've written to do the same thing with a USB-to-serial adapter, the image I get back is not the same as the image I receive through the USB-to-serial adapter is not consistent at all. A final thing is that when I use a terminal program to dump the binary image with the USB-serial adapter, the image is correct. Every time! What is the terminal program doing that's not being done in my application? My application is quite simple. Has anyone observed this behavior before? If you have, I'd like to know how you've gotten around this problem. Thanks, LT =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From tjarvi at qbang.org Tue Apr 22 21:11:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 22 Apr 2008 21:11:10 -0600 (MDT) Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0023.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0021.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0008.html From pboulton at pulsetracer.com Fri Apr 18 14:30:13 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Fri, 18 Apr 2008 13:30:13 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site Message-ID: <480904D5.1060307@pulsetracer.com> Hello, gentle serial porters. I have downloaded the zipped up binaries for use on Windows without Sun's CommAPI, but don't seem able to extract anything from the download. Go to main page, http://www.rxtx.org/ Click on Downloads I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) And I save it to disk. If I try and extract the files with WinZip, Winzip thinks the archive is corrupt. If I try using Windows Explorer, I am able to extract it into a single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than the original .zip. Any help would be much appreciated. Sincerely, Philip Boulton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080418/97d89793/attachment-0006.html From tjarvi at qbang.org Fri Apr 18 19:07:00 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 18 Apr 2008 19:07:00 -0600 (MDT) Subject: [Rxtx] Difficulty opening zip file at rxtx site In-Reply-To: <480904D5.1060307@pulsetracer.com> References: <480904D5.1060307@pulsetracer.com> Message-ID: On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org From pboulton at pulsetracer.com Sat Apr 19 12:46:26 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Sat, 19 Apr 2008 11:46:26 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site References: <480904D5.1060307@pulsetracer.com> Message-ID: <53DB7576450695419E09299104043761A78533@ZTGSERVER.ztg.local> I have been able to get my hands on the binaries, by going to the ftp directory /pub/rxtx at ftp.qbang.org,, and ftping the file rxtx-2.1-7-bins-r2.zip . This opens happily with Winzip, and extracts as the set of files that you describe below. I only experience the ill-formed archive problem by clicking the link on the rxtx.org Downloads page (http://rxtx.qbang.org/pub/rxtx/ rxtx-2.1-7-bins-r2.zip ). Not sure what to make of that. Philip Boulton ________________________________ From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Fri 4/18/2008 6:07 PM To: Philip Boulton Cc: rxtx at qbang.org Subject: Re: [Rxtx] Difficulty opening zip file at rxtx site On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080419/147923bb/attachment-0005.html From jlar310 at gmail.com Sat Apr 19 19:11:55 2008 From: jlar310 at gmail.com (Jeff Larsen) Date: Sat, 19 Apr 2008 20:11:55 -0500 Subject: [Rxtx] Moxa serial over Ethernet driver Message-ID: Hi all, I've been using javax.comm for years to communicate with a legacy radio data system. We want to migrate the java side of the system to a VMware Server virtual machine. We've had great success using Moxa DE-303 and 5610 serial over Ethernet appliances and virtual machines for running hylafax. The OS (Linux in this case) uses a kernel driver to communicate with the Moxa via a virtual serial port such as /dev/ttyr00. I want to do the same thing with javax.comm or gnu.io to connect to a virtual serial port. However I'm hitting road blocks everywhere. javax.comm for Linux sees the virtual port, but there are transmission errors. Tried Solaris too, but the Solaris Moxa drivers don't play nice with javax.comm because the driver uses /dev/pts/n instead of /dev/term/x. Next I tried RXTX on Linux, but I'm getting NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX on Solaris. Has anyone used RXTX with serial over Ethernet devices? Any hints on how to make it work? I know that I'm not completely off track because javax.comm does work with Moxa on a Windows platform, but that's just not an option for production deployment. -- Jeff From tjarvi at qbang.org Sat Apr 19 21:08:41 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 19 Apr 2008 21:08:41 -0600 (MDT) Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: yOn Sat, 19 Apr 2008, Jeff Larsen wrote: > Hi all, > > I've been using javax.comm for years to communicate with a legacy > radio data system. We want to migrate the java side of the system to a > VMware Server virtual machine. We've had great success using Moxa > DE-303 and 5610 serial over Ethernet appliances and virtual machines > for running hylafax. The OS (Linux in this case) uses a kernel driver > to communicate with the Moxa via a virtual serial port such as > /dev/ttyr00. > > I want to do the same thing with javax.comm or gnu.io to connect to a > virtual serial port. However I'm hitting road blocks everywhere. > javax.comm for Linux sees the virtual port, but there are transmission > errors. Tried Solaris too, but the Solaris Moxa drivers don't play > nice with javax.comm because the driver uses /dev/pts/n instead of > /dev/term/x. Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris. > > Has anyone used RXTX with serial over Ethernet devices? Any hints on > how to make it work? > > I know that I'm not completely off track because javax.comm does work > with Moxa on a Windows platform, but that's just not an option for > production deployment. > > Moxa should work under linux. There may be minor issues depending upon how complete the kernel driver is but I think it will work. One of the minor issues is /dev/ttyr00 is not enumerated. There are several work arounds documented with the source code and on the wiki. The easiest solution for testing purposes is to make a symbolic link from /dev/ttyr00 to a port that is enumerated such as /dev/ttyS129. You can later alter the rxtx source or use properties to change the enumerated ports. -- Trent Jarvi tjarvi at qbang.org From d.tonhofer at m-plify.com Sun Apr 20 03:33:30 2008 From: d.tonhofer at m-plify.com (David Tonhofer (M-PLIFY S.A.)) Date: Sun, 20 Apr 2008 11:33:30 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: <480B0DEA.5010908@m-plify.com> Jeff Larsen wrote: > Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris It might be that the Java side of RXTX does not recognize that portname. Trying modifying src/RXTXCommDriver.java as described in this case: http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card From ajmas at sympatico.ca Sun Apr 20 16:37:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Apr 2008 18:37:59 -0400 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <480B0DEA.5010908@m-plify.com> References: <480B0DEA.5010908@m-plify.com> Message-ID: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > Jeff Larsen wrote: >> Next I tried RXTX on Linux, but I'm getting >> NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX >> on Solaris > It might be that the Java side of RXTX does not recognize that > portname. > Trying modifying src/RXTXCommDriver.java as described in this case: > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card I wonder whether it would be worth allowing custom port prefixes as a system parameter? For example: gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" Andre From Martin.Oberhuber at windriver.com Tue Apr 22 12:34:36 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 22 Apr 2008 20:34:36 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> References: <480B0DEA.5010908@m-plify.com> <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE6485848056CD6CE@ism-mail03.corp.ad.wrs.com> Sounds like a great idea... I'm wondering how the "variable part" after the Prefixes could be specified though? What about allowing Regular Expression character Classes in the existing System Property for specifying ports: System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyS[0-9],ttyS[ABC],ttyUSB[0-9a-z]"); The set of allowed patterns would of course need to Be restricted compared to REGEX, because it must be A syntax that supports iterating over it. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Montag, 21. April 2008 00:38 > To: rxtx at qbang.org and Users > Subject: Re: [Rxtx] Moxa serial over Ethernet driver > > > On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > > Jeff Larsen wrote: > >> Next I tried RXTX on Linux, but I'm getting > >> NoSuchPortException connecting to /dev/ttyr00. I have yet > to try RXTX > >> on Solaris > > It might be that the Java side of RXTX does not recognize that > > portname. > > Trying modifying src/RXTXCommDriver.java as described in this case: > > > > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_ > SST-4P.2FLP_multiport_card > > I wonder whether it would be worth allowing custom port > prefixes as a > system parameter? For > example: > > gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Loi.TRAN at weatherford.com Tue Apr 22 13:10:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Tue, 22 Apr 2008 14:10:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled Message-ID: Hi, I'm currently using the Java RXTX API to interface to a serial port. The serial port is connected to a bridge board that communicates with our communications system running at 1.875 Mbps which is linked to an embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no flow control). I send a command to the embedded board through the serial-bridge board which then is relayed to the embedded board. The command sent asks the embedded board to dump a binary image. Here's where I'm hitting some problems. I've successfully done this is an integrated serial port from the laptop. The binary file that comes back is consistent on every attempt. When I use the application I've written to do the same thing with a USB-to-serial adapter, the image I get back is not the same as the image I receive through the USB-to-serial adapter is not consistent at all. A final thing is that when I use a terminal program to dump the binary image with the USB-serial adapter, the image is correct. Every time! What is the terminal program doing that's not being done in my application? My application is quite simple. Has anyone observed this behavior before? If you have, I'd like to know how you've gotten around this problem. Thanks, LT =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From tjarvi at qbang.org Tue Apr 22 21:11:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 22 Apr 2008 21:11:10 -0600 (MDT) Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org From Loi.TRAN at weatherford.com Wed Apr 23 08:35:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Wed, 23 Apr 2008 09:35:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: Thanks for all the responses. I finally tried something that worked consistently. I updated my Prolific driver and repeated my tests. It worked. If you're using the Prolific type USB-serial adapters, do no use the Prolific version 2.0.2.1 driver on Windows. Update it to the latest 2.0.2.8 version. Again, thanks for all the responses. LT -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Tuesday, April 22, 2008 10:11 PM To: TRAN, Loi X. Cc: rxtx at qbang.org Subject: Re: [Rxtx] Prolific USB - RXTX data mangled On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From Martin.Oberhuber at windriver.com Wed Apr 23 18:54:26 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 02:54:26 +0200 Subject: [Rxtx] RXTX port locking on Linux status? Message-ID: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Dear RXTX community, I'm wondering what the status is with RXTX locking serial ports on Linux? My understanding is that the mechanism used in 2.1-7r2 (lockfiles) is not really state of the art, and has lots of problems (e.g. missing permissions). There was an idea to migrate towards a Kernel syscall based solution for port locking. What's the status here? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/9878db9f/attachment.html From tjarvi at qbang.org Wed Apr 23 20:32:24 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Apr 2008 20:32:24 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > Dear RXTX community, > > I'm wondering what the status is with RXTX locking > serial ports on Linux? > > My understanding is that the mechanism used in > 2.1-7r2 (lockfiles) is not really state of the art, and > has lots of problems (e.g. missing permissions). > > There was an idea to migrate towards a Kernel > syscall based solution for port locking. > > What's the status here? > Hi Martin, I'm in favor of deprecating the current FHS locking mechanism in favor of an IOCTL when available. I think it will be available on all the platforms but do not know for sure. The status is unchanged. I've had very few free cycles for such things. Feel free to take a stab at it if you have some time. I believe the IOCTL is used in the Mac OS X code already. I don't see any real backwards compatability issues and the IOCTL should just work. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Apr 24 06:14:06 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 14:14:06 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Thanks Trent. Problem is only that I'm really not at all Familiar with the C part of RXTX. If there Were anything I could do in Java for this, It would be easier for me.... ... Are there any C experts here on the list Who'd like to look at ioctl port locking For linux? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Donnerstag, 24. April 2008 04:32 > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > I'm wondering what the status is with RXTX locking > > serial ports on Linux? > > > > My understanding is that the mechanism used in > > 2.1-7r2 (lockfiles) is not really state of the art, and > > has lots of problems (e.g. missing permissions). > > > > There was an idea to migrate towards a Kernel > > syscall based solution for port locking. > > > > What's the status here? > > > > Hi Martin, > > I'm in favor of deprecating the current FHS locking mechanism > in favor of > an IOCTL when available. I think it will be available on all the > platforms but do not know for sure. > > The status is unchanged. I've had very few free cycles for > such things. > Feel free to take a stab at it if you have some time. I > believe the IOCTL > is used in the Mac OS X code already. > > I don't see any real backwards compatability issues and the > IOCTL should > just work. > > -- > Trent Jarvi > tjarvi at qbang.org > From sspies at sloc.de Thu Apr 24 07:15:36 2008 From: sspies at sloc.de (Sebastian Spies) Date: Thu, 24 Apr 2008 15:15:36 +0200 (CEST) Subject: [Rxtx] rxtx on gumstix: Interrupted system call In-Reply-To: <47FB7B20.7080504@sloc.de> References: <47FB7B20.7080504@sloc.de> Message-ID: <55445.130.83.139.205.1209042936.squirrel@ssl.sloc.de> Dear list, while porting rxtx to the gumstix, I found out, that select used in readArray in SerialImp.c might not work as expected. Maybe, because of missing TIOCSERGETLSR-support? select is often interrupted, so i wrote the following quick'n'dirty hack to make it work on gumstix: diff -Nur rxtx-2.1-7r2/src/SerialImp.c rxtx-2.1-7r2/src/SerialImp.c --- rxtx-2.1-7r2/src/SerialImp.c 2006-01-29 23:19:04.000000000 +0100 +++ rxtx-2.1-7r2-patched/src/SerialImp.c 2008-04-24 14:30:17.000000000 +0200 @@ -3380,7 +3381,7 @@ JNIEXPORT jint JNICALL RXTXPort(readArray)( JNIEnv *env, jobject jobj, jbyteArray jbarray, jint offset, jint length ) { - int bytes; + int bytes = 0; jbyte *body; /* char msg[80]; */ int fd = get_java_var( env, jobj, "fd", "I" ); @@ -3397,9 +3398,18 @@ "readArray", "Invalid length" ); return -1; } - body = (*env)->GetByteArrayElements( env, jbarray, 0 ); - bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ - (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + while(1 > bytes) + { + body = (*env)->GetByteArrayElements( env, jbarray, 0 ); + bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ + (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + // quick'n'dirty - SSP + report (" trying again... \n"); + errno = 0; + } + if( bytes < 0 ) { report( "RXTXPort:readArray bytes < 0" ); LEAVE( "RXTXPort:readArray" ); > Hey, > > I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use > RXTXPort$SerialInputStream.read(), then I get the following Exception. I > did not yet figure out which system call is interrupted as strace > produces loads of output. > > Any help would be very appreciated. Thanks in advance. > Sebastian > > > [java] java.io.IOException: Interrupted system call in readArray > [java] at gnu.io.RXTXPort.readArray(Native Method) > [java] at > gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) > [java] at > java.io.FilterInputStream.read(FilterInputStream.java:189) > [java] at > java.io.BufferedInputStream.refill(BufferedInputStream.java:371) > [java] at > java.io.BufferedInputStream.read(BufferedInputStream.java:229) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) > [java] at > com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) > > -- > Sebastian Spies > > mail: sspies at sloc.de > > > > From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0024.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0022.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0009.html From pboulton at pulsetracer.com Fri Apr 18 14:30:13 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Fri, 18 Apr 2008 13:30:13 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site Message-ID: <480904D5.1060307@pulsetracer.com> Hello, gentle serial porters. I have downloaded the zipped up binaries for use on Windows without Sun's CommAPI, but don't seem able to extract anything from the download. Go to main page, http://www.rxtx.org/ Click on Downloads I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) And I save it to disk. If I try and extract the files with WinZip, Winzip thinks the archive is corrupt. If I try using Windows Explorer, I am able to extract it into a single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than the original .zip. Any help would be much appreciated. Sincerely, Philip Boulton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080418/97d89793/attachment-0007.html From tjarvi at qbang.org Fri Apr 18 19:07:00 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 18 Apr 2008 19:07:00 -0600 (MDT) Subject: [Rxtx] Difficulty opening zip file at rxtx site In-Reply-To: <480904D5.1060307@pulsetracer.com> References: <480904D5.1060307@pulsetracer.com> Message-ID: On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org From pboulton at pulsetracer.com Sat Apr 19 12:46:26 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Sat, 19 Apr 2008 11:46:26 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site References: <480904D5.1060307@pulsetracer.com> Message-ID: <53DB7576450695419E09299104043761A78533@ZTGSERVER.ztg.local> I have been able to get my hands on the binaries, by going to the ftp directory /pub/rxtx at ftp.qbang.org,, and ftping the file rxtx-2.1-7-bins-r2.zip . This opens happily with Winzip, and extracts as the set of files that you describe below. I only experience the ill-formed archive problem by clicking the link on the rxtx.org Downloads page (http://rxtx.qbang.org/pub/rxtx/ rxtx-2.1-7-bins-r2.zip ). Not sure what to make of that. Philip Boulton ________________________________ From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Fri 4/18/2008 6:07 PM To: Philip Boulton Cc: rxtx at qbang.org Subject: Re: [Rxtx] Difficulty opening zip file at rxtx site On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080419/147923bb/attachment-0006.html From jlar310 at gmail.com Sat Apr 19 19:11:55 2008 From: jlar310 at gmail.com (Jeff Larsen) Date: Sat, 19 Apr 2008 20:11:55 -0500 Subject: [Rxtx] Moxa serial over Ethernet driver Message-ID: Hi all, I've been using javax.comm for years to communicate with a legacy radio data system. We want to migrate the java side of the system to a VMware Server virtual machine. We've had great success using Moxa DE-303 and 5610 serial over Ethernet appliances and virtual machines for running hylafax. The OS (Linux in this case) uses a kernel driver to communicate with the Moxa via a virtual serial port such as /dev/ttyr00. I want to do the same thing with javax.comm or gnu.io to connect to a virtual serial port. However I'm hitting road blocks everywhere. javax.comm for Linux sees the virtual port, but there are transmission errors. Tried Solaris too, but the Solaris Moxa drivers don't play nice with javax.comm because the driver uses /dev/pts/n instead of /dev/term/x. Next I tried RXTX on Linux, but I'm getting NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX on Solaris. Has anyone used RXTX with serial over Ethernet devices? Any hints on how to make it work? I know that I'm not completely off track because javax.comm does work with Moxa on a Windows platform, but that's just not an option for production deployment. -- Jeff From tjarvi at qbang.org Sat Apr 19 21:08:41 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 19 Apr 2008 21:08:41 -0600 (MDT) Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: yOn Sat, 19 Apr 2008, Jeff Larsen wrote: > Hi all, > > I've been using javax.comm for years to communicate with a legacy > radio data system. We want to migrate the java side of the system to a > VMware Server virtual machine. We've had great success using Moxa > DE-303 and 5610 serial over Ethernet appliances and virtual machines > for running hylafax. The OS (Linux in this case) uses a kernel driver > to communicate with the Moxa via a virtual serial port such as > /dev/ttyr00. > > I want to do the same thing with javax.comm or gnu.io to connect to a > virtual serial port. However I'm hitting road blocks everywhere. > javax.comm for Linux sees the virtual port, but there are transmission > errors. Tried Solaris too, but the Solaris Moxa drivers don't play > nice with javax.comm because the driver uses /dev/pts/n instead of > /dev/term/x. Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris. > > Has anyone used RXTX with serial over Ethernet devices? Any hints on > how to make it work? > > I know that I'm not completely off track because javax.comm does work > with Moxa on a Windows platform, but that's just not an option for > production deployment. > > Moxa should work under linux. There may be minor issues depending upon how complete the kernel driver is but I think it will work. One of the minor issues is /dev/ttyr00 is not enumerated. There are several work arounds documented with the source code and on the wiki. The easiest solution for testing purposes is to make a symbolic link from /dev/ttyr00 to a port that is enumerated such as /dev/ttyS129. You can later alter the rxtx source or use properties to change the enumerated ports. -- Trent Jarvi tjarvi at qbang.org From d.tonhofer at m-plify.com Sun Apr 20 03:33:30 2008 From: d.tonhofer at m-plify.com (David Tonhofer (M-PLIFY S.A.)) Date: Sun, 20 Apr 2008 11:33:30 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: <480B0DEA.5010908@m-plify.com> Jeff Larsen wrote: > Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris It might be that the Java side of RXTX does not recognize that portname. Trying modifying src/RXTXCommDriver.java as described in this case: http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card From ajmas at sympatico.ca Sun Apr 20 16:37:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Apr 2008 18:37:59 -0400 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <480B0DEA.5010908@m-plify.com> References: <480B0DEA.5010908@m-plify.com> Message-ID: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > Jeff Larsen wrote: >> Next I tried RXTX on Linux, but I'm getting >> NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX >> on Solaris > It might be that the Java side of RXTX does not recognize that > portname. > Trying modifying src/RXTXCommDriver.java as described in this case: > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card I wonder whether it would be worth allowing custom port prefixes as a system parameter? For example: gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" Andre From Martin.Oberhuber at windriver.com Tue Apr 22 12:34:36 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 22 Apr 2008 20:34:36 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> References: <480B0DEA.5010908@m-plify.com> <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE6485848056CD6CE@ism-mail03.corp.ad.wrs.com> Sounds like a great idea... I'm wondering how the "variable part" after the Prefixes could be specified though? What about allowing Regular Expression character Classes in the existing System Property for specifying ports: System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyS[0-9],ttyS[ABC],ttyUSB[0-9a-z]"); The set of allowed patterns would of course need to Be restricted compared to REGEX, because it must be A syntax that supports iterating over it. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Montag, 21. April 2008 00:38 > To: rxtx at qbang.org and Users > Subject: Re: [Rxtx] Moxa serial over Ethernet driver > > > On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > > Jeff Larsen wrote: > >> Next I tried RXTX on Linux, but I'm getting > >> NoSuchPortException connecting to /dev/ttyr00. I have yet > to try RXTX > >> on Solaris > > It might be that the Java side of RXTX does not recognize that > > portname. > > Trying modifying src/RXTXCommDriver.java as described in this case: > > > > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_ > SST-4P.2FLP_multiport_card > > I wonder whether it would be worth allowing custom port > prefixes as a > system parameter? For > example: > > gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Loi.TRAN at weatherford.com Tue Apr 22 13:10:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Tue, 22 Apr 2008 14:10:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled Message-ID: Hi, I'm currently using the Java RXTX API to interface to a serial port. The serial port is connected to a bridge board that communicates with our communications system running at 1.875 Mbps which is linked to an embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no flow control). I send a command to the embedded board through the serial-bridge board which then is relayed to the embedded board. The command sent asks the embedded board to dump a binary image. Here's where I'm hitting some problems. I've successfully done this is an integrated serial port from the laptop. The binary file that comes back is consistent on every attempt. When I use the application I've written to do the same thing with a USB-to-serial adapter, the image I get back is not the same as the image I receive through the USB-to-serial adapter is not consistent at all. A final thing is that when I use a terminal program to dump the binary image with the USB-serial adapter, the image is correct. Every time! What is the terminal program doing that's not being done in my application? My application is quite simple. Has anyone observed this behavior before? If you have, I'd like to know how you've gotten around this problem. Thanks, LT =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From tjarvi at qbang.org Tue Apr 22 21:11:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 22 Apr 2008 21:11:10 -0600 (MDT) Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org From Loi.TRAN at weatherford.com Wed Apr 23 08:35:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Wed, 23 Apr 2008 09:35:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: Thanks for all the responses. I finally tried something that worked consistently. I updated my Prolific driver and repeated my tests. It worked. If you're using the Prolific type USB-serial adapters, do no use the Prolific version 2.0.2.1 driver on Windows. Update it to the latest 2.0.2.8 version. Again, thanks for all the responses. LT -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Tuesday, April 22, 2008 10:11 PM To: TRAN, Loi X. Cc: rxtx at qbang.org Subject: Re: [Rxtx] Prolific USB - RXTX data mangled On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From Martin.Oberhuber at windriver.com Wed Apr 23 18:54:26 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 02:54:26 +0200 Subject: [Rxtx] RXTX port locking on Linux status? Message-ID: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Dear RXTX community, I'm wondering what the status is with RXTX locking serial ports on Linux? My understanding is that the mechanism used in 2.1-7r2 (lockfiles) is not really state of the art, and has lots of problems (e.g. missing permissions). There was an idea to migrate towards a Kernel syscall based solution for port locking. What's the status here? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/9878db9f/attachment-0002.html From tjarvi at qbang.org Wed Apr 23 20:32:24 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Apr 2008 20:32:24 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > Dear RXTX community, > > I'm wondering what the status is with RXTX locking > serial ports on Linux? > > My understanding is that the mechanism used in > 2.1-7r2 (lockfiles) is not really state of the art, and > has lots of problems (e.g. missing permissions). > > There was an idea to migrate towards a Kernel > syscall based solution for port locking. > > What's the status here? > Hi Martin, I'm in favor of deprecating the current FHS locking mechanism in favor of an IOCTL when available. I think it will be available on all the platforms but do not know for sure. The status is unchanged. I've had very few free cycles for such things. Feel free to take a stab at it if you have some time. I believe the IOCTL is used in the Mac OS X code already. I don't see any real backwards compatability issues and the IOCTL should just work. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Apr 24 06:14:06 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 14:14:06 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Thanks Trent. Problem is only that I'm really not at all Familiar with the C part of RXTX. If there Were anything I could do in Java for this, It would be easier for me.... ... Are there any C experts here on the list Who'd like to look at ioctl port locking For linux? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Donnerstag, 24. April 2008 04:32 > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > I'm wondering what the status is with RXTX locking > > serial ports on Linux? > > > > My understanding is that the mechanism used in > > 2.1-7r2 (lockfiles) is not really state of the art, and > > has lots of problems (e.g. missing permissions). > > > > There was an idea to migrate towards a Kernel > > syscall based solution for port locking. > > > > What's the status here? > > > > Hi Martin, > > I'm in favor of deprecating the current FHS locking mechanism > in favor of > an IOCTL when available. I think it will be available on all the > platforms but do not know for sure. > > The status is unchanged. I've had very few free cycles for > such things. > Feel free to take a stab at it if you have some time. I > believe the IOCTL > is used in the Mac OS X code already. > > I don't see any real backwards compatability issues and the > IOCTL should > just work. > > -- > Trent Jarvi > tjarvi at qbang.org > From sspies at sloc.de Thu Apr 24 07:15:36 2008 From: sspies at sloc.de (Sebastian Spies) Date: Thu, 24 Apr 2008 15:15:36 +0200 (CEST) Subject: [Rxtx] rxtx on gumstix: Interrupted system call In-Reply-To: <47FB7B20.7080504@sloc.de> References: <47FB7B20.7080504@sloc.de> Message-ID: <55445.130.83.139.205.1209042936.squirrel@ssl.sloc.de> Dear list, while porting rxtx to the gumstix, I found out, that select used in readArray in SerialImp.c might not work as expected. Maybe, because of missing TIOCSERGETLSR-support? select is often interrupted, so i wrote the following quick'n'dirty hack to make it work on gumstix: diff -Nur rxtx-2.1-7r2/src/SerialImp.c rxtx-2.1-7r2/src/SerialImp.c --- rxtx-2.1-7r2/src/SerialImp.c 2006-01-29 23:19:04.000000000 +0100 +++ rxtx-2.1-7r2-patched/src/SerialImp.c 2008-04-24 14:30:17.000000000 +0200 @@ -3380,7 +3381,7 @@ JNIEXPORT jint JNICALL RXTXPort(readArray)( JNIEnv *env, jobject jobj, jbyteArray jbarray, jint offset, jint length ) { - int bytes; + int bytes = 0; jbyte *body; /* char msg[80]; */ int fd = get_java_var( env, jobj, "fd", "I" ); @@ -3397,9 +3398,18 @@ "readArray", "Invalid length" ); return -1; } - body = (*env)->GetByteArrayElements( env, jbarray, 0 ); - bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ - (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + while(1 > bytes) + { + body = (*env)->GetByteArrayElements( env, jbarray, 0 ); + bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ + (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + // quick'n'dirty - SSP + report (" trying again... \n"); + errno = 0; + } + if( bytes < 0 ) { report( "RXTXPort:readArray bytes < 0" ); LEAVE( "RXTXPort:readArray" ); > Hey, > > I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use > RXTXPort$SerialInputStream.read(), then I get the following Exception. I > did not yet figure out which system call is interrupted as strace > produces loads of output. > > Any help would be very appreciated. Thanks in advance. > Sebastian > > > [java] java.io.IOException: Interrupted system call in readArray > [java] at gnu.io.RXTXPort.readArray(Native Method) > [java] at > gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) > [java] at > java.io.FilterInputStream.read(FilterInputStream.java:189) > [java] at > java.io.BufferedInputStream.refill(BufferedInputStream.java:371) > [java] at > java.io.BufferedInputStream.read(BufferedInputStream.java:229) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) > [java] at > com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) > > -- > Sebastian Spies > > mail: sspies at sloc.de > > > > From fire_baptized at hotmail.com Thu Apr 24 18:27:48 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Thu, 24 Apr 2008 20:27:48 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hello I am having a problem with the serial device connecting (software wise) to the serial port. However I have a test program and it seems to work just fine in that environment - and it doesnt use GUI. The error I am getting is : PortNotFoundException Now the way I have it setup in the GUI environment is that once the user pushes a JButton the program connects using this class: protected void establishConnection() { try { portId = CommPortIdentifier.getPortIdentifier("COM3"); System.out.println("Establishing connction....."); messages[0] = "\nEstablishing connction.....\n"; } catch ( NoSuchPortException noport) { System.out.println("Port not found: "+ noport); messages[0] = "Port not found: "+ noport+"\n"; } try { serialPort = (SerialPort) portId.open("serial", 50); System.out.println("Port has been found."); messages[1] = "Port has been found.\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[1] = "" +usedport; } try { serialPort = (SerialPort) portId.open("serial", 50); messages[2] = "Connecting to COM3 on port 50....\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; } try { serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); System.out.println("Esablishing the transfer rate settings for COM3."); messages[3] = "Esablishing the transfer rate settings for COM3.\n"; } catch (UnsupportedCommOperationException nosupcom) { System.out.println(nosupcom); System.out.println("The tranfer rate could not be esblished on COM3."); messages[3] = "The tranfer rate could not be esblished on COM3.\n"; } System.out.println(serialPort.getFlowControlMode()); messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; //sendDataOut(buffer[3],buffer[4]); } I need all the data in this method (and all the string values in this method) to be printed out on a JTextArea. I wont do me any good if not all the text is printed on a JTextArea in another class. So I have the text printing the JTextArea correctly, but everytime the JButton is activated - it gives me that error message. I did add a disconnect button that is supposed to call the serialPort.close(). _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/273fd4ec/attachment.html From tjarvi at qbang.org Thu Apr 24 21:54:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Apr 2008 21:54:10 -0600 (MDT) Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > Hello I am having a problem with the serial device connecting (software > wise) to the serial port. However I have a test program and it seems to > work just fine in that environment - and it doesnt use GUI. The error I > am getting is : PortNotFoundException Now the way I have it setup in the > GUI environment is that once the user pushes a JButton the program > connects using this class: > > protected void establishConnection() { > try { > portId = CommPortIdentifier.getPortIdentifier("COM3"); > System.out.println("Establishing connction....."); > messages[0] = "\nEstablishing connction.....\n"; > } > catch ( NoSuchPortException noport) { > System.out.println("Port not found: "+ noport); > messages[0] = "Port not found: "+ noport+"\n"; > } > try { > serialPort = (SerialPort) portId.open("serial", 50); > System.out.println("Port has been found."); > messages[1] = "Port has been found.\n"; > } > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[1] = "" +usedport; > } ================================================================= > try { > serialPort = (SerialPort) portId.open("serial", 50); > messages[2] = "Connecting to COM3 on port 50....\n"; > } ================================================================== > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > } > try { > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > System.out.println("Esablishing the transfer rate settings for COM3."); > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > } > catch (UnsupportedCommOperationException nosupcom) { > System.out.println(nosupcom); > System.out.println("The tranfer rate could not be esblished on COM3."); > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > } > System.out.println(serialPort.getFlowControlMode()); > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > //sendDataOut(buffer[3],buffer[4]); > } > > I need all the data in this method (and all the string values in this > method) to be printed out on a JTextArea. I wont do me any good if not > all the text is printed on a JTextArea in another class. So I have the > text printing the JTextArea correctly, but everytime the JButton is > activated - it gives me that error message. I did add a disconnect > button that is supposed to call the serialPort.close(). > The open code used twice is going to throw an exception. It may be that you catch the exception above this code and print a confusing message? A common mistake is people will accidently run two copies of their program. The first instance of the program will open the port and prevent enumeration (finding the port) in the second instance of the program. As an example, you may be running your text based application which is preventing the GUI from seeing the port. Enumeration is done by trying to open the port. If the port is open, Enumeration fails. -- Trent Jarvi tjarvi at qbang.org From fire_baptized at hotmail.com Thu Apr 24 22:32:05 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 00:32:05 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Wow - thanks dude what a dumb thing for me to not catch..... now here is the current problem - right now I am trying to output data again one is with the test program - and it seems that serialPort.setRTS(true); is throwing an exceptions there - now if I show this code please bare in mind that I am only testing - the code is kinda sloppy in my mind - but if I can figure out why calling this function is throwing an exception then maybe I can figure out why my GUI application is getting the same null pointer exceptions when try to send out the data stream. FYI Trent this email is not directed towards you - anyone can jump in on this public static void main(String args[]) { byte[] b = new byte[64]; int keyinput = 0 ; byte x = 0; byte y = 0; PortTesting1 testports = new PortTesting1(); try { joyskoro = Joystick.createInstance(); } catch (IOException ioexc) { System.out.println("There is an input/output problem: " + ioexc); } while (true) { joyskoro.poll(); b[0] = ((byte) -(10 * joyskoro.getY())); b[1] = ((byte) (10 * joyskoro.getX())); System.out.println("The 3rd byte is: " +b[0]); System.out.println("The 4rd byte is: " +b[1]); serialPort.setRTS(true); // HERE IS WHERE THE PROBLEM IS !!!!!!! ON THIS LINE but if I dont have it active in my program the Bluetooth device (that is System.out.println("Ready to send :-) !"); //connected to the serial port does not send out data!!!!! if (joyskoro.isButtonDown(joyskoro.BUTTON10)) { System.out.println("Connection terminated."); serialPort.close(); break; } if (joyskoro.isButtonDown(joyskoro.BUTTON2)) { boolean flag = true; //reading from key input from the keyboard System.out.println("Please input a command: "); while (flag) { try { keyinput = System.in.read(); } catch (IOException ioexc) {/*there is no need to put * anything here */ } if((char)keyinput=='w') { pushIt((byte)85); } if((char)keyinput=='s') { pushIt((byte)84); } if((char)keyinput=='a') { pushIt((byte)83); } if((char)keyinput=='d') { pushIt((byte)82); } if((char)keyinput=='q') { pushIt((byte)89); } if((char)keyinput=='\t') { //this stop reading input from the keyboard flag = false; } } and help anyways here is the block of code that throwing an exception for the test program: > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/5c8f7d68/attachment-0001.html From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0025.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0023.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0010.html From pboulton at pulsetracer.com Fri Apr 18 14:30:13 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Fri, 18 Apr 2008 13:30:13 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site Message-ID: <480904D5.1060307@pulsetracer.com> Hello, gentle serial porters. I have downloaded the zipped up binaries for use on Windows without Sun's CommAPI, but don't seem able to extract anything from the download. Go to main page, http://www.rxtx.org/ Click on Downloads I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) And I save it to disk. If I try and extract the files with WinZip, Winzip thinks the archive is corrupt. If I try using Windows Explorer, I am able to extract it into a single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than the original .zip. Any help would be much appreciated. Sincerely, Philip Boulton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080418/97d89793/attachment-0008.html From tjarvi at qbang.org Fri Apr 18 19:07:00 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 18 Apr 2008 19:07:00 -0600 (MDT) Subject: [Rxtx] Difficulty opening zip file at rxtx site In-Reply-To: <480904D5.1060307@pulsetracer.com> References: <480904D5.1060307@pulsetracer.com> Message-ID: On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org From pboulton at pulsetracer.com Sat Apr 19 12:46:26 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Sat, 19 Apr 2008 11:46:26 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site References: <480904D5.1060307@pulsetracer.com> Message-ID: <53DB7576450695419E09299104043761A78533@ZTGSERVER.ztg.local> I have been able to get my hands on the binaries, by going to the ftp directory /pub/rxtx at ftp.qbang.org,, and ftping the file rxtx-2.1-7-bins-r2.zip . This opens happily with Winzip, and extracts as the set of files that you describe below. I only experience the ill-formed archive problem by clicking the link on the rxtx.org Downloads page (http://rxtx.qbang.org/pub/rxtx/ rxtx-2.1-7-bins-r2.zip ). Not sure what to make of that. Philip Boulton ________________________________ From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Fri 4/18/2008 6:07 PM To: Philip Boulton Cc: rxtx at qbang.org Subject: Re: [Rxtx] Difficulty opening zip file at rxtx site On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080419/147923bb/attachment-0007.html From jlar310 at gmail.com Sat Apr 19 19:11:55 2008 From: jlar310 at gmail.com (Jeff Larsen) Date: Sat, 19 Apr 2008 20:11:55 -0500 Subject: [Rxtx] Moxa serial over Ethernet driver Message-ID: Hi all, I've been using javax.comm for years to communicate with a legacy radio data system. We want to migrate the java side of the system to a VMware Server virtual machine. We've had great success using Moxa DE-303 and 5610 serial over Ethernet appliances and virtual machines for running hylafax. The OS (Linux in this case) uses a kernel driver to communicate with the Moxa via a virtual serial port such as /dev/ttyr00. I want to do the same thing with javax.comm or gnu.io to connect to a virtual serial port. However I'm hitting road blocks everywhere. javax.comm for Linux sees the virtual port, but there are transmission errors. Tried Solaris too, but the Solaris Moxa drivers don't play nice with javax.comm because the driver uses /dev/pts/n instead of /dev/term/x. Next I tried RXTX on Linux, but I'm getting NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX on Solaris. Has anyone used RXTX with serial over Ethernet devices? Any hints on how to make it work? I know that I'm not completely off track because javax.comm does work with Moxa on a Windows platform, but that's just not an option for production deployment. -- Jeff From tjarvi at qbang.org Sat Apr 19 21:08:41 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 19 Apr 2008 21:08:41 -0600 (MDT) Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: yOn Sat, 19 Apr 2008, Jeff Larsen wrote: > Hi all, > > I've been using javax.comm for years to communicate with a legacy > radio data system. We want to migrate the java side of the system to a > VMware Server virtual machine. We've had great success using Moxa > DE-303 and 5610 serial over Ethernet appliances and virtual machines > for running hylafax. The OS (Linux in this case) uses a kernel driver > to communicate with the Moxa via a virtual serial port such as > /dev/ttyr00. > > I want to do the same thing with javax.comm or gnu.io to connect to a > virtual serial port. However I'm hitting road blocks everywhere. > javax.comm for Linux sees the virtual port, but there are transmission > errors. Tried Solaris too, but the Solaris Moxa drivers don't play > nice with javax.comm because the driver uses /dev/pts/n instead of > /dev/term/x. Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris. > > Has anyone used RXTX with serial over Ethernet devices? Any hints on > how to make it work? > > I know that I'm not completely off track because javax.comm does work > with Moxa on a Windows platform, but that's just not an option for > production deployment. > > Moxa should work under linux. There may be minor issues depending upon how complete the kernel driver is but I think it will work. One of the minor issues is /dev/ttyr00 is not enumerated. There are several work arounds documented with the source code and on the wiki. The easiest solution for testing purposes is to make a symbolic link from /dev/ttyr00 to a port that is enumerated such as /dev/ttyS129. You can later alter the rxtx source or use properties to change the enumerated ports. -- Trent Jarvi tjarvi at qbang.org From d.tonhofer at m-plify.com Sun Apr 20 03:33:30 2008 From: d.tonhofer at m-plify.com (David Tonhofer (M-PLIFY S.A.)) Date: Sun, 20 Apr 2008 11:33:30 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: <480B0DEA.5010908@m-plify.com> Jeff Larsen wrote: > Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris It might be that the Java side of RXTX does not recognize that portname. Trying modifying src/RXTXCommDriver.java as described in this case: http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card From ajmas at sympatico.ca Sun Apr 20 16:37:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Apr 2008 18:37:59 -0400 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <480B0DEA.5010908@m-plify.com> References: <480B0DEA.5010908@m-plify.com> Message-ID: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > Jeff Larsen wrote: >> Next I tried RXTX on Linux, but I'm getting >> NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX >> on Solaris > It might be that the Java side of RXTX does not recognize that > portname. > Trying modifying src/RXTXCommDriver.java as described in this case: > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card I wonder whether it would be worth allowing custom port prefixes as a system parameter? For example: gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" Andre From Martin.Oberhuber at windriver.com Tue Apr 22 12:34:36 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 22 Apr 2008 20:34:36 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> References: <480B0DEA.5010908@m-plify.com> <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE6485848056CD6CE@ism-mail03.corp.ad.wrs.com> Sounds like a great idea... I'm wondering how the "variable part" after the Prefixes could be specified though? What about allowing Regular Expression character Classes in the existing System Property for specifying ports: System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyS[0-9],ttyS[ABC],ttyUSB[0-9a-z]"); The set of allowed patterns would of course need to Be restricted compared to REGEX, because it must be A syntax that supports iterating over it. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Montag, 21. April 2008 00:38 > To: rxtx at qbang.org and Users > Subject: Re: [Rxtx] Moxa serial over Ethernet driver > > > On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > > Jeff Larsen wrote: > >> Next I tried RXTX on Linux, but I'm getting > >> NoSuchPortException connecting to /dev/ttyr00. I have yet > to try RXTX > >> on Solaris > > It might be that the Java side of RXTX does not recognize that > > portname. > > Trying modifying src/RXTXCommDriver.java as described in this case: > > > > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_ > SST-4P.2FLP_multiport_card > > I wonder whether it would be worth allowing custom port > prefixes as a > system parameter? For > example: > > gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Loi.TRAN at weatherford.com Tue Apr 22 13:10:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Tue, 22 Apr 2008 14:10:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled Message-ID: Hi, I'm currently using the Java RXTX API to interface to a serial port. The serial port is connected to a bridge board that communicates with our communications system running at 1.875 Mbps which is linked to an embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no flow control). I send a command to the embedded board through the serial-bridge board which then is relayed to the embedded board. The command sent asks the embedded board to dump a binary image. Here's where I'm hitting some problems. I've successfully done this is an integrated serial port from the laptop. The binary file that comes back is consistent on every attempt. When I use the application I've written to do the same thing with a USB-to-serial adapter, the image I get back is not the same as the image I receive through the USB-to-serial adapter is not consistent at all. A final thing is that when I use a terminal program to dump the binary image with the USB-serial adapter, the image is correct. Every time! What is the terminal program doing that's not being done in my application? My application is quite simple. Has anyone observed this behavior before? If you have, I'd like to know how you've gotten around this problem. Thanks, LT =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From tjarvi at qbang.org Tue Apr 22 21:11:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 22 Apr 2008 21:11:10 -0600 (MDT) Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org From Loi.TRAN at weatherford.com Wed Apr 23 08:35:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Wed, 23 Apr 2008 09:35:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: Thanks for all the responses. I finally tried something that worked consistently. I updated my Prolific driver and repeated my tests. It worked. If you're using the Prolific type USB-serial adapters, do no use the Prolific version 2.0.2.1 driver on Windows. Update it to the latest 2.0.2.8 version. Again, thanks for all the responses. LT -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Tuesday, April 22, 2008 10:11 PM To: TRAN, Loi X. Cc: rxtx at qbang.org Subject: Re: [Rxtx] Prolific USB - RXTX data mangled On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From Martin.Oberhuber at windriver.com Wed Apr 23 18:54:26 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 02:54:26 +0200 Subject: [Rxtx] RXTX port locking on Linux status? Message-ID: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Dear RXTX community, I'm wondering what the status is with RXTX locking serial ports on Linux? My understanding is that the mechanism used in 2.1-7r2 (lockfiles) is not really state of the art, and has lots of problems (e.g. missing permissions). There was an idea to migrate towards a Kernel syscall based solution for port locking. What's the status here? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/9878db9f/attachment-0003.html From tjarvi at qbang.org Wed Apr 23 20:32:24 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Apr 2008 20:32:24 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > Dear RXTX community, > > I'm wondering what the status is with RXTX locking > serial ports on Linux? > > My understanding is that the mechanism used in > 2.1-7r2 (lockfiles) is not really state of the art, and > has lots of problems (e.g. missing permissions). > > There was an idea to migrate towards a Kernel > syscall based solution for port locking. > > What's the status here? > Hi Martin, I'm in favor of deprecating the current FHS locking mechanism in favor of an IOCTL when available. I think it will be available on all the platforms but do not know for sure. The status is unchanged. I've had very few free cycles for such things. Feel free to take a stab at it if you have some time. I believe the IOCTL is used in the Mac OS X code already. I don't see any real backwards compatability issues and the IOCTL should just work. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Apr 24 06:14:06 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 14:14:06 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Thanks Trent. Problem is only that I'm really not at all Familiar with the C part of RXTX. If there Were anything I could do in Java for this, It would be easier for me.... ... Are there any C experts here on the list Who'd like to look at ioctl port locking For linux? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Donnerstag, 24. April 2008 04:32 > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > I'm wondering what the status is with RXTX locking > > serial ports on Linux? > > > > My understanding is that the mechanism used in > > 2.1-7r2 (lockfiles) is not really state of the art, and > > has lots of problems (e.g. missing permissions). > > > > There was an idea to migrate towards a Kernel > > syscall based solution for port locking. > > > > What's the status here? > > > > Hi Martin, > > I'm in favor of deprecating the current FHS locking mechanism > in favor of > an IOCTL when available. I think it will be available on all the > platforms but do not know for sure. > > The status is unchanged. I've had very few free cycles for > such things. > Feel free to take a stab at it if you have some time. I > believe the IOCTL > is used in the Mac OS X code already. > > I don't see any real backwards compatability issues and the > IOCTL should > just work. > > -- > Trent Jarvi > tjarvi at qbang.org > From sspies at sloc.de Thu Apr 24 07:15:36 2008 From: sspies at sloc.de (Sebastian Spies) Date: Thu, 24 Apr 2008 15:15:36 +0200 (CEST) Subject: [Rxtx] rxtx on gumstix: Interrupted system call In-Reply-To: <47FB7B20.7080504@sloc.de> References: <47FB7B20.7080504@sloc.de> Message-ID: <55445.130.83.139.205.1209042936.squirrel@ssl.sloc.de> Dear list, while porting rxtx to the gumstix, I found out, that select used in readArray in SerialImp.c might not work as expected. Maybe, because of missing TIOCSERGETLSR-support? select is often interrupted, so i wrote the following quick'n'dirty hack to make it work on gumstix: diff -Nur rxtx-2.1-7r2/src/SerialImp.c rxtx-2.1-7r2/src/SerialImp.c --- rxtx-2.1-7r2/src/SerialImp.c 2006-01-29 23:19:04.000000000 +0100 +++ rxtx-2.1-7r2-patched/src/SerialImp.c 2008-04-24 14:30:17.000000000 +0200 @@ -3380,7 +3381,7 @@ JNIEXPORT jint JNICALL RXTXPort(readArray)( JNIEnv *env, jobject jobj, jbyteArray jbarray, jint offset, jint length ) { - int bytes; + int bytes = 0; jbyte *body; /* char msg[80]; */ int fd = get_java_var( env, jobj, "fd", "I" ); @@ -3397,9 +3398,18 @@ "readArray", "Invalid length" ); return -1; } - body = (*env)->GetByteArrayElements( env, jbarray, 0 ); - bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ - (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + while(1 > bytes) + { + body = (*env)->GetByteArrayElements( env, jbarray, 0 ); + bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ + (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + // quick'n'dirty - SSP + report (" trying again... \n"); + errno = 0; + } + if( bytes < 0 ) { report( "RXTXPort:readArray bytes < 0" ); LEAVE( "RXTXPort:readArray" ); > Hey, > > I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use > RXTXPort$SerialInputStream.read(), then I get the following Exception. I > did not yet figure out which system call is interrupted as strace > produces loads of output. > > Any help would be very appreciated. Thanks in advance. > Sebastian > > > [java] java.io.IOException: Interrupted system call in readArray > [java] at gnu.io.RXTXPort.readArray(Native Method) > [java] at > gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) > [java] at > java.io.FilterInputStream.read(FilterInputStream.java:189) > [java] at > java.io.BufferedInputStream.refill(BufferedInputStream.java:371) > [java] at > java.io.BufferedInputStream.read(BufferedInputStream.java:229) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) > [java] at > com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) > > -- > Sebastian Spies > > mail: sspies at sloc.de > > > > From fire_baptized at hotmail.com Thu Apr 24 18:27:48 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Thu, 24 Apr 2008 20:27:48 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hello I am having a problem with the serial device connecting (software wise) to the serial port. However I have a test program and it seems to work just fine in that environment - and it doesnt use GUI. The error I am getting is : PortNotFoundException Now the way I have it setup in the GUI environment is that once the user pushes a JButton the program connects using this class: protected void establishConnection() { try { portId = CommPortIdentifier.getPortIdentifier("COM3"); System.out.println("Establishing connction....."); messages[0] = "\nEstablishing connction.....\n"; } catch ( NoSuchPortException noport) { System.out.println("Port not found: "+ noport); messages[0] = "Port not found: "+ noport+"\n"; } try { serialPort = (SerialPort) portId.open("serial", 50); System.out.println("Port has been found."); messages[1] = "Port has been found.\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[1] = "" +usedport; } try { serialPort = (SerialPort) portId.open("serial", 50); messages[2] = "Connecting to COM3 on port 50....\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; } try { serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); System.out.println("Esablishing the transfer rate settings for COM3."); messages[3] = "Esablishing the transfer rate settings for COM3.\n"; } catch (UnsupportedCommOperationException nosupcom) { System.out.println(nosupcom); System.out.println("The tranfer rate could not be esblished on COM3."); messages[3] = "The tranfer rate could not be esblished on COM3.\n"; } System.out.println(serialPort.getFlowControlMode()); messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; //sendDataOut(buffer[3],buffer[4]); } I need all the data in this method (and all the string values in this method) to be printed out on a JTextArea. I wont do me any good if not all the text is printed on a JTextArea in another class. So I have the text printing the JTextArea correctly, but everytime the JButton is activated - it gives me that error message. I did add a disconnect button that is supposed to call the serialPort.close(). _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/273fd4ec/attachment-0002.html From tjarvi at qbang.org Thu Apr 24 21:54:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Apr 2008 21:54:10 -0600 (MDT) Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > Hello I am having a problem with the serial device connecting (software > wise) to the serial port. However I have a test program and it seems to > work just fine in that environment - and it doesnt use GUI. The error I > am getting is : PortNotFoundException Now the way I have it setup in the > GUI environment is that once the user pushes a JButton the program > connects using this class: > > protected void establishConnection() { > try { > portId = CommPortIdentifier.getPortIdentifier("COM3"); > System.out.println("Establishing connction....."); > messages[0] = "\nEstablishing connction.....\n"; > } > catch ( NoSuchPortException noport) { > System.out.println("Port not found: "+ noport); > messages[0] = "Port not found: "+ noport+"\n"; > } > try { > serialPort = (SerialPort) portId.open("serial", 50); > System.out.println("Port has been found."); > messages[1] = "Port has been found.\n"; > } > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[1] = "" +usedport; > } ================================================================= > try { > serialPort = (SerialPort) portId.open("serial", 50); > messages[2] = "Connecting to COM3 on port 50....\n"; > } ================================================================== > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > } > try { > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > System.out.println("Esablishing the transfer rate settings for COM3."); > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > } > catch (UnsupportedCommOperationException nosupcom) { > System.out.println(nosupcom); > System.out.println("The tranfer rate could not be esblished on COM3."); > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > } > System.out.println(serialPort.getFlowControlMode()); > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > //sendDataOut(buffer[3],buffer[4]); > } > > I need all the data in this method (and all the string values in this > method) to be printed out on a JTextArea. I wont do me any good if not > all the text is printed on a JTextArea in another class. So I have the > text printing the JTextArea correctly, but everytime the JButton is > activated - it gives me that error message. I did add a disconnect > button that is supposed to call the serialPort.close(). > The open code used twice is going to throw an exception. It may be that you catch the exception above this code and print a confusing message? A common mistake is people will accidently run two copies of their program. The first instance of the program will open the port and prevent enumeration (finding the port) in the second instance of the program. As an example, you may be running your text based application which is preventing the GUI from seeing the port. Enumeration is done by trying to open the port. If the port is open, Enumeration fails. -- Trent Jarvi tjarvi at qbang.org From fire_baptized at hotmail.com Thu Apr 24 22:32:05 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 00:32:05 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Wow - thanks dude what a dumb thing for me to not catch..... now here is the current problem - right now I am trying to output data again one is with the test program - and it seems that serialPort.setRTS(true); is throwing an exceptions there - now if I show this code please bare in mind that I am only testing - the code is kinda sloppy in my mind - but if I can figure out why calling this function is throwing an exception then maybe I can figure out why my GUI application is getting the same null pointer exceptions when try to send out the data stream. FYI Trent this email is not directed towards you - anyone can jump in on this public static void main(String args[]) { byte[] b = new byte[64]; int keyinput = 0 ; byte x = 0; byte y = 0; PortTesting1 testports = new PortTesting1(); try { joyskoro = Joystick.createInstance(); } catch (IOException ioexc) { System.out.println("There is an input/output problem: " + ioexc); } while (true) { joyskoro.poll(); b[0] = ((byte) -(10 * joyskoro.getY())); b[1] = ((byte) (10 * joyskoro.getX())); System.out.println("The 3rd byte is: " +b[0]); System.out.println("The 4rd byte is: " +b[1]); serialPort.setRTS(true); // HERE IS WHERE THE PROBLEM IS !!!!!!! ON THIS LINE but if I dont have it active in my program the Bluetooth device (that is System.out.println("Ready to send :-) !"); //connected to the serial port does not send out data!!!!! if (joyskoro.isButtonDown(joyskoro.BUTTON10)) { System.out.println("Connection terminated."); serialPort.close(); break; } if (joyskoro.isButtonDown(joyskoro.BUTTON2)) { boolean flag = true; //reading from key input from the keyboard System.out.println("Please input a command: "); while (flag) { try { keyinput = System.in.read(); } catch (IOException ioexc) {/*there is no need to put * anything here */ } if((char)keyinput=='w') { pushIt((byte)85); } if((char)keyinput=='s') { pushIt((byte)84); } if((char)keyinput=='a') { pushIt((byte)83); } if((char)keyinput=='d') { pushIt((byte)82); } if((char)keyinput=='q') { pushIt((byte)89); } if((char)keyinput=='\t') { //this stop reading input from the keyboard flag = false; } } and help anyways here is the block of code that throwing an exception for the test program: > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/5c8f7d68/attachment-0002.html From fire_baptized at hotmail.com Fri Apr 25 07:59:53 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 09:59:53 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Are there any examples of how to push out data? As in using input and output streams - if I can compare code maybe I can see where this is causing a problem. I have a byte array that I am pushing out data. I keep getting null pointer exceptions every where I turn. > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/22228ab6/attachment.html From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0026.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0024.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0011.html From pboulton at pulsetracer.com Fri Apr 18 14:30:13 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Fri, 18 Apr 2008 13:30:13 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site Message-ID: <480904D5.1060307@pulsetracer.com> Hello, gentle serial porters. I have downloaded the zipped up binaries for use on Windows without Sun's CommAPI, but don't seem able to extract anything from the download. Go to main page, http://www.rxtx.org/ Click on Downloads I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) And I save it to disk. If I try and extract the files with WinZip, Winzip thinks the archive is corrupt. If I try using Windows Explorer, I am able to extract it into a single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than the original .zip. Any help would be much appreciated. Sincerely, Philip Boulton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080418/97d89793/attachment-0009.html From tjarvi at qbang.org Fri Apr 18 19:07:00 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 18 Apr 2008 19:07:00 -0600 (MDT) Subject: [Rxtx] Difficulty opening zip file at rxtx site In-Reply-To: <480904D5.1060307@pulsetracer.com> References: <480904D5.1060307@pulsetracer.com> Message-ID: On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org From pboulton at pulsetracer.com Sat Apr 19 12:46:26 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Sat, 19 Apr 2008 11:46:26 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site References: <480904D5.1060307@pulsetracer.com> Message-ID: <53DB7576450695419E09299104043761A78533@ZTGSERVER.ztg.local> I have been able to get my hands on the binaries, by going to the ftp directory /pub/rxtx at ftp.qbang.org,, and ftping the file rxtx-2.1-7-bins-r2.zip . This opens happily with Winzip, and extracts as the set of files that you describe below. I only experience the ill-formed archive problem by clicking the link on the rxtx.org Downloads page (http://rxtx.qbang.org/pub/rxtx/ rxtx-2.1-7-bins-r2.zip ). Not sure what to make of that. Philip Boulton ________________________________ From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Fri 4/18/2008 6:07 PM To: Philip Boulton Cc: rxtx at qbang.org Subject: Re: [Rxtx] Difficulty opening zip file at rxtx site On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080419/147923bb/attachment-0008.html From jlar310 at gmail.com Sat Apr 19 19:11:55 2008 From: jlar310 at gmail.com (Jeff Larsen) Date: Sat, 19 Apr 2008 20:11:55 -0500 Subject: [Rxtx] Moxa serial over Ethernet driver Message-ID: Hi all, I've been using javax.comm for years to communicate with a legacy radio data system. We want to migrate the java side of the system to a VMware Server virtual machine. We've had great success using Moxa DE-303 and 5610 serial over Ethernet appliances and virtual machines for running hylafax. The OS (Linux in this case) uses a kernel driver to communicate with the Moxa via a virtual serial port such as /dev/ttyr00. I want to do the same thing with javax.comm or gnu.io to connect to a virtual serial port. However I'm hitting road blocks everywhere. javax.comm for Linux sees the virtual port, but there are transmission errors. Tried Solaris too, but the Solaris Moxa drivers don't play nice with javax.comm because the driver uses /dev/pts/n instead of /dev/term/x. Next I tried RXTX on Linux, but I'm getting NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX on Solaris. Has anyone used RXTX with serial over Ethernet devices? Any hints on how to make it work? I know that I'm not completely off track because javax.comm does work with Moxa on a Windows platform, but that's just not an option for production deployment. -- Jeff From tjarvi at qbang.org Sat Apr 19 21:08:41 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 19 Apr 2008 21:08:41 -0600 (MDT) Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: yOn Sat, 19 Apr 2008, Jeff Larsen wrote: > Hi all, > > I've been using javax.comm for years to communicate with a legacy > radio data system. We want to migrate the java side of the system to a > VMware Server virtual machine. We've had great success using Moxa > DE-303 and 5610 serial over Ethernet appliances and virtual machines > for running hylafax. The OS (Linux in this case) uses a kernel driver > to communicate with the Moxa via a virtual serial port such as > /dev/ttyr00. > > I want to do the same thing with javax.comm or gnu.io to connect to a > virtual serial port. However I'm hitting road blocks everywhere. > javax.comm for Linux sees the virtual port, but there are transmission > errors. Tried Solaris too, but the Solaris Moxa drivers don't play > nice with javax.comm because the driver uses /dev/pts/n instead of > /dev/term/x. Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris. > > Has anyone used RXTX with serial over Ethernet devices? Any hints on > how to make it work? > > I know that I'm not completely off track because javax.comm does work > with Moxa on a Windows platform, but that's just not an option for > production deployment. > > Moxa should work under linux. There may be minor issues depending upon how complete the kernel driver is but I think it will work. One of the minor issues is /dev/ttyr00 is not enumerated. There are several work arounds documented with the source code and on the wiki. The easiest solution for testing purposes is to make a symbolic link from /dev/ttyr00 to a port that is enumerated such as /dev/ttyS129. You can later alter the rxtx source or use properties to change the enumerated ports. -- Trent Jarvi tjarvi at qbang.org From d.tonhofer at m-plify.com Sun Apr 20 03:33:30 2008 From: d.tonhofer at m-plify.com (David Tonhofer (M-PLIFY S.A.)) Date: Sun, 20 Apr 2008 11:33:30 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: <480B0DEA.5010908@m-plify.com> Jeff Larsen wrote: > Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris It might be that the Java side of RXTX does not recognize that portname. Trying modifying src/RXTXCommDriver.java as described in this case: http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card From ajmas at sympatico.ca Sun Apr 20 16:37:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Apr 2008 18:37:59 -0400 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <480B0DEA.5010908@m-plify.com> References: <480B0DEA.5010908@m-plify.com> Message-ID: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > Jeff Larsen wrote: >> Next I tried RXTX on Linux, but I'm getting >> NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX >> on Solaris > It might be that the Java side of RXTX does not recognize that > portname. > Trying modifying src/RXTXCommDriver.java as described in this case: > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card I wonder whether it would be worth allowing custom port prefixes as a system parameter? For example: gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" Andre From Martin.Oberhuber at windriver.com Tue Apr 22 12:34:36 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 22 Apr 2008 20:34:36 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> References: <480B0DEA.5010908@m-plify.com> <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE6485848056CD6CE@ism-mail03.corp.ad.wrs.com> Sounds like a great idea... I'm wondering how the "variable part" after the Prefixes could be specified though? What about allowing Regular Expression character Classes in the existing System Property for specifying ports: System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyS[0-9],ttyS[ABC],ttyUSB[0-9a-z]"); The set of allowed patterns would of course need to Be restricted compared to REGEX, because it must be A syntax that supports iterating over it. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Montag, 21. April 2008 00:38 > To: rxtx at qbang.org and Users > Subject: Re: [Rxtx] Moxa serial over Ethernet driver > > > On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > > Jeff Larsen wrote: > >> Next I tried RXTX on Linux, but I'm getting > >> NoSuchPortException connecting to /dev/ttyr00. I have yet > to try RXTX > >> on Solaris > > It might be that the Java side of RXTX does not recognize that > > portname. > > Trying modifying src/RXTXCommDriver.java as described in this case: > > > > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_ > SST-4P.2FLP_multiport_card > > I wonder whether it would be worth allowing custom port > prefixes as a > system parameter? For > example: > > gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Loi.TRAN at weatherford.com Tue Apr 22 13:10:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Tue, 22 Apr 2008 14:10:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled Message-ID: Hi, I'm currently using the Java RXTX API to interface to a serial port. The serial port is connected to a bridge board that communicates with our communications system running at 1.875 Mbps which is linked to an embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no flow control). I send a command to the embedded board through the serial-bridge board which then is relayed to the embedded board. The command sent asks the embedded board to dump a binary image. Here's where I'm hitting some problems. I've successfully done this is an integrated serial port from the laptop. The binary file that comes back is consistent on every attempt. When I use the application I've written to do the same thing with a USB-to-serial adapter, the image I get back is not the same as the image I receive through the USB-to-serial adapter is not consistent at all. A final thing is that when I use a terminal program to dump the binary image with the USB-serial adapter, the image is correct. Every time! What is the terminal program doing that's not being done in my application? My application is quite simple. Has anyone observed this behavior before? If you have, I'd like to know how you've gotten around this problem. Thanks, LT =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From tjarvi at qbang.org Tue Apr 22 21:11:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 22 Apr 2008 21:11:10 -0600 (MDT) Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org From Loi.TRAN at weatherford.com Wed Apr 23 08:35:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Wed, 23 Apr 2008 09:35:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: Thanks for all the responses. I finally tried something that worked consistently. I updated my Prolific driver and repeated my tests. It worked. If you're using the Prolific type USB-serial adapters, do no use the Prolific version 2.0.2.1 driver on Windows. Update it to the latest 2.0.2.8 version. Again, thanks for all the responses. LT -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Tuesday, April 22, 2008 10:11 PM To: TRAN, Loi X. Cc: rxtx at qbang.org Subject: Re: [Rxtx] Prolific USB - RXTX data mangled On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From Martin.Oberhuber at windriver.com Wed Apr 23 18:54:26 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 02:54:26 +0200 Subject: [Rxtx] RXTX port locking on Linux status? Message-ID: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Dear RXTX community, I'm wondering what the status is with RXTX locking serial ports on Linux? My understanding is that the mechanism used in 2.1-7r2 (lockfiles) is not really state of the art, and has lots of problems (e.g. missing permissions). There was an idea to migrate towards a Kernel syscall based solution for port locking. What's the status here? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/9878db9f/attachment-0004.html From tjarvi at qbang.org Wed Apr 23 20:32:24 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Apr 2008 20:32:24 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > Dear RXTX community, > > I'm wondering what the status is with RXTX locking > serial ports on Linux? > > My understanding is that the mechanism used in > 2.1-7r2 (lockfiles) is not really state of the art, and > has lots of problems (e.g. missing permissions). > > There was an idea to migrate towards a Kernel > syscall based solution for port locking. > > What's the status here? > Hi Martin, I'm in favor of deprecating the current FHS locking mechanism in favor of an IOCTL when available. I think it will be available on all the platforms but do not know for sure. The status is unchanged. I've had very few free cycles for such things. Feel free to take a stab at it if you have some time. I believe the IOCTL is used in the Mac OS X code already. I don't see any real backwards compatability issues and the IOCTL should just work. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Apr 24 06:14:06 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 14:14:06 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Thanks Trent. Problem is only that I'm really not at all Familiar with the C part of RXTX. If there Were anything I could do in Java for this, It would be easier for me.... ... Are there any C experts here on the list Who'd like to look at ioctl port locking For linux? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Donnerstag, 24. April 2008 04:32 > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > I'm wondering what the status is with RXTX locking > > serial ports on Linux? > > > > My understanding is that the mechanism used in > > 2.1-7r2 (lockfiles) is not really state of the art, and > > has lots of problems (e.g. missing permissions). > > > > There was an idea to migrate towards a Kernel > > syscall based solution for port locking. > > > > What's the status here? > > > > Hi Martin, > > I'm in favor of deprecating the current FHS locking mechanism > in favor of > an IOCTL when available. I think it will be available on all the > platforms but do not know for sure. > > The status is unchanged. I've had very few free cycles for > such things. > Feel free to take a stab at it if you have some time. I > believe the IOCTL > is used in the Mac OS X code already. > > I don't see any real backwards compatability issues and the > IOCTL should > just work. > > -- > Trent Jarvi > tjarvi at qbang.org > From sspies at sloc.de Thu Apr 24 07:15:36 2008 From: sspies at sloc.de (Sebastian Spies) Date: Thu, 24 Apr 2008 15:15:36 +0200 (CEST) Subject: [Rxtx] rxtx on gumstix: Interrupted system call In-Reply-To: <47FB7B20.7080504@sloc.de> References: <47FB7B20.7080504@sloc.de> Message-ID: <55445.130.83.139.205.1209042936.squirrel@ssl.sloc.de> Dear list, while porting rxtx to the gumstix, I found out, that select used in readArray in SerialImp.c might not work as expected. Maybe, because of missing TIOCSERGETLSR-support? select is often interrupted, so i wrote the following quick'n'dirty hack to make it work on gumstix: diff -Nur rxtx-2.1-7r2/src/SerialImp.c rxtx-2.1-7r2/src/SerialImp.c --- rxtx-2.1-7r2/src/SerialImp.c 2006-01-29 23:19:04.000000000 +0100 +++ rxtx-2.1-7r2-patched/src/SerialImp.c 2008-04-24 14:30:17.000000000 +0200 @@ -3380,7 +3381,7 @@ JNIEXPORT jint JNICALL RXTXPort(readArray)( JNIEnv *env, jobject jobj, jbyteArray jbarray, jint offset, jint length ) { - int bytes; + int bytes = 0; jbyte *body; /* char msg[80]; */ int fd = get_java_var( env, jobj, "fd", "I" ); @@ -3397,9 +3398,18 @@ "readArray", "Invalid length" ); return -1; } - body = (*env)->GetByteArrayElements( env, jbarray, 0 ); - bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ - (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + while(1 > bytes) + { + body = (*env)->GetByteArrayElements( env, jbarray, 0 ); + bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ + (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + // quick'n'dirty - SSP + report (" trying again... \n"); + errno = 0; + } + if( bytes < 0 ) { report( "RXTXPort:readArray bytes < 0" ); LEAVE( "RXTXPort:readArray" ); > Hey, > > I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use > RXTXPort$SerialInputStream.read(), then I get the following Exception. I > did not yet figure out which system call is interrupted as strace > produces loads of output. > > Any help would be very appreciated. Thanks in advance. > Sebastian > > > [java] java.io.IOException: Interrupted system call in readArray > [java] at gnu.io.RXTXPort.readArray(Native Method) > [java] at > gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) > [java] at > java.io.FilterInputStream.read(FilterInputStream.java:189) > [java] at > java.io.BufferedInputStream.refill(BufferedInputStream.java:371) > [java] at > java.io.BufferedInputStream.read(BufferedInputStream.java:229) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) > [java] at > com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) > > -- > Sebastian Spies > > mail: sspies at sloc.de > > > > From fire_baptized at hotmail.com Thu Apr 24 18:27:48 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Thu, 24 Apr 2008 20:27:48 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hello I am having a problem with the serial device connecting (software wise) to the serial port. However I have a test program and it seems to work just fine in that environment - and it doesnt use GUI. The error I am getting is : PortNotFoundException Now the way I have it setup in the GUI environment is that once the user pushes a JButton the program connects using this class: protected void establishConnection() { try { portId = CommPortIdentifier.getPortIdentifier("COM3"); System.out.println("Establishing connction....."); messages[0] = "\nEstablishing connction.....\n"; } catch ( NoSuchPortException noport) { System.out.println("Port not found: "+ noport); messages[0] = "Port not found: "+ noport+"\n"; } try { serialPort = (SerialPort) portId.open("serial", 50); System.out.println("Port has been found."); messages[1] = "Port has been found.\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[1] = "" +usedport; } try { serialPort = (SerialPort) portId.open("serial", 50); messages[2] = "Connecting to COM3 on port 50....\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; } try { serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); System.out.println("Esablishing the transfer rate settings for COM3."); messages[3] = "Esablishing the transfer rate settings for COM3.\n"; } catch (UnsupportedCommOperationException nosupcom) { System.out.println(nosupcom); System.out.println("The tranfer rate could not be esblished on COM3."); messages[3] = "The tranfer rate could not be esblished on COM3.\n"; } System.out.println(serialPort.getFlowControlMode()); messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; //sendDataOut(buffer[3],buffer[4]); } I need all the data in this method (and all the string values in this method) to be printed out on a JTextArea. I wont do me any good if not all the text is printed on a JTextArea in another class. So I have the text printing the JTextArea correctly, but everytime the JButton is activated - it gives me that error message. I did add a disconnect button that is supposed to call the serialPort.close(). _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/273fd4ec/attachment-0003.html From tjarvi at qbang.org Thu Apr 24 21:54:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Apr 2008 21:54:10 -0600 (MDT) Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > Hello I am having a problem with the serial device connecting (software > wise) to the serial port. However I have a test program and it seems to > work just fine in that environment - and it doesnt use GUI. The error I > am getting is : PortNotFoundException Now the way I have it setup in the > GUI environment is that once the user pushes a JButton the program > connects using this class: > > protected void establishConnection() { > try { > portId = CommPortIdentifier.getPortIdentifier("COM3"); > System.out.println("Establishing connction....."); > messages[0] = "\nEstablishing connction.....\n"; > } > catch ( NoSuchPortException noport) { > System.out.println("Port not found: "+ noport); > messages[0] = "Port not found: "+ noport+"\n"; > } > try { > serialPort = (SerialPort) portId.open("serial", 50); > System.out.println("Port has been found."); > messages[1] = "Port has been found.\n"; > } > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[1] = "" +usedport; > } ================================================================= > try { > serialPort = (SerialPort) portId.open("serial", 50); > messages[2] = "Connecting to COM3 on port 50....\n"; > } ================================================================== > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > } > try { > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > System.out.println("Esablishing the transfer rate settings for COM3."); > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > } > catch (UnsupportedCommOperationException nosupcom) { > System.out.println(nosupcom); > System.out.println("The tranfer rate could not be esblished on COM3."); > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > } > System.out.println(serialPort.getFlowControlMode()); > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > //sendDataOut(buffer[3],buffer[4]); > } > > I need all the data in this method (and all the string values in this > method) to be printed out on a JTextArea. I wont do me any good if not > all the text is printed on a JTextArea in another class. So I have the > text printing the JTextArea correctly, but everytime the JButton is > activated - it gives me that error message. I did add a disconnect > button that is supposed to call the serialPort.close(). > The open code used twice is going to throw an exception. It may be that you catch the exception above this code and print a confusing message? A common mistake is people will accidently run two copies of their program. The first instance of the program will open the port and prevent enumeration (finding the port) in the second instance of the program. As an example, you may be running your text based application which is preventing the GUI from seeing the port. Enumeration is done by trying to open the port. If the port is open, Enumeration fails. -- Trent Jarvi tjarvi at qbang.org From fire_baptized at hotmail.com Thu Apr 24 22:32:05 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 00:32:05 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Wow - thanks dude what a dumb thing for me to not catch..... now here is the current problem - right now I am trying to output data again one is with the test program - and it seems that serialPort.setRTS(true); is throwing an exceptions there - now if I show this code please bare in mind that I am only testing - the code is kinda sloppy in my mind - but if I can figure out why calling this function is throwing an exception then maybe I can figure out why my GUI application is getting the same null pointer exceptions when try to send out the data stream. FYI Trent this email is not directed towards you - anyone can jump in on this public static void main(String args[]) { byte[] b = new byte[64]; int keyinput = 0 ; byte x = 0; byte y = 0; PortTesting1 testports = new PortTesting1(); try { joyskoro = Joystick.createInstance(); } catch (IOException ioexc) { System.out.println("There is an input/output problem: " + ioexc); } while (true) { joyskoro.poll(); b[0] = ((byte) -(10 * joyskoro.getY())); b[1] = ((byte) (10 * joyskoro.getX())); System.out.println("The 3rd byte is: " +b[0]); System.out.println("The 4rd byte is: " +b[1]); serialPort.setRTS(true); // HERE IS WHERE THE PROBLEM IS !!!!!!! ON THIS LINE but if I dont have it active in my program the Bluetooth device (that is System.out.println("Ready to send :-) !"); //connected to the serial port does not send out data!!!!! if (joyskoro.isButtonDown(joyskoro.BUTTON10)) { System.out.println("Connection terminated."); serialPort.close(); break; } if (joyskoro.isButtonDown(joyskoro.BUTTON2)) { boolean flag = true; //reading from key input from the keyboard System.out.println("Please input a command: "); while (flag) { try { keyinput = System.in.read(); } catch (IOException ioexc) {/*there is no need to put * anything here */ } if((char)keyinput=='w') { pushIt((byte)85); } if((char)keyinput=='s') { pushIt((byte)84); } if((char)keyinput=='a') { pushIt((byte)83); } if((char)keyinput=='d') { pushIt((byte)82); } if((char)keyinput=='q') { pushIt((byte)89); } if((char)keyinput=='\t') { //this stop reading input from the keyboard flag = false; } } and help anyways here is the block of code that throwing an exception for the test program: > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/5c8f7d68/attachment-0003.html From fire_baptized at hotmail.com Fri Apr 25 07:59:53 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 09:59:53 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Are there any examples of how to push out data? As in using input and output streams - if I can compare code maybe I can see where this is causing a problem. I have a byte array that I am pushing out data. I keep getting null pointer exceptions every where I turn. > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/22228ab6/attachment-0001.html From ajmas at sympatico.ca Sat Apr 26 07:37:09 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 26 Apr 2008 09:37:09 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hi, On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote: > > Are there any examples of how to push out data? As in using input > and output streams - if I can compare code maybe I can see where > this is causing a problem. I have a byte array that I am pushing > out data. I keep getting null pointer exceptions every where I turn. > There are some examples here that might be of help: http://rxtx.qbang.org/wiki/index.php/Examples Andre From fire_baptized at hotmail.com Sat Apr 26 20:13:54 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Sat, 26 Apr 2008 22:13:54 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: looked at those....yep didnt help - I need to push out data with GUI and not get a null pointer exception everytime I try. > CC: rxtx at qbang.org> From: ajmas at sympatico.ca> To: fire_baptized at hotmail.com> Subject: Re: [Rxtx] Serial Problems with Gui.....> Date: Sat, 26 Apr 2008 09:37:09 -0400> > Hi,> > > On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote:> >> > Are there any examples of how to push out data? As in using input > > and output streams - if I can compare code maybe I can see where > > this is causing a problem. I have a byte array that I am pushing > > out data. I keep getting null pointer exceptions every where I turn.> >> > There are some examples here that might be of help:> > http://rxtx.qbang.org/wiki/index.php/Examples> > Andre _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080426/09f95b41/attachment.html From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0027.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0025.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0012.html From pboulton at pulsetracer.com Fri Apr 18 14:30:13 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Fri, 18 Apr 2008 13:30:13 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site Message-ID: <480904D5.1060307@pulsetracer.com> Hello, gentle serial porters. I have downloaded the zipped up binaries for use on Windows without Sun's CommAPI, but don't seem able to extract anything from the download. Go to main page, http://www.rxtx.org/ Click on Downloads I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) And I save it to disk. If I try and extract the files with WinZip, Winzip thinks the archive is corrupt. If I try using Windows Explorer, I am able to extract it into a single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than the original .zip. Any help would be much appreciated. Sincerely, Philip Boulton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080418/97d89793/attachment-0010.html From tjarvi at qbang.org Fri Apr 18 19:07:00 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 18 Apr 2008 19:07:00 -0600 (MDT) Subject: [Rxtx] Difficulty opening zip file at rxtx site In-Reply-To: <480904D5.1060307@pulsetracer.com> References: <480904D5.1060307@pulsetracer.com> Message-ID: On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org From pboulton at pulsetracer.com Sat Apr 19 12:46:26 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Sat, 19 Apr 2008 11:46:26 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site References: <480904D5.1060307@pulsetracer.com> Message-ID: <53DB7576450695419E09299104043761A78533@ZTGSERVER.ztg.local> I have been able to get my hands on the binaries, by going to the ftp directory /pub/rxtx at ftp.qbang.org,, and ftping the file rxtx-2.1-7-bins-r2.zip . This opens happily with Winzip, and extracts as the set of files that you describe below. I only experience the ill-formed archive problem by clicking the link on the rxtx.org Downloads page (http://rxtx.qbang.org/pub/rxtx/ rxtx-2.1-7-bins-r2.zip ). Not sure what to make of that. Philip Boulton ________________________________ From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Fri 4/18/2008 6:07 PM To: Philip Boulton Cc: rxtx at qbang.org Subject: Re: [Rxtx] Difficulty opening zip file at rxtx site On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080419/147923bb/attachment-0009.html From jlar310 at gmail.com Sat Apr 19 19:11:55 2008 From: jlar310 at gmail.com (Jeff Larsen) Date: Sat, 19 Apr 2008 20:11:55 -0500 Subject: [Rxtx] Moxa serial over Ethernet driver Message-ID: Hi all, I've been using javax.comm for years to communicate with a legacy radio data system. We want to migrate the java side of the system to a VMware Server virtual machine. We've had great success using Moxa DE-303 and 5610 serial over Ethernet appliances and virtual machines for running hylafax. The OS (Linux in this case) uses a kernel driver to communicate with the Moxa via a virtual serial port such as /dev/ttyr00. I want to do the same thing with javax.comm or gnu.io to connect to a virtual serial port. However I'm hitting road blocks everywhere. javax.comm for Linux sees the virtual port, but there are transmission errors. Tried Solaris too, but the Solaris Moxa drivers don't play nice with javax.comm because the driver uses /dev/pts/n instead of /dev/term/x. Next I tried RXTX on Linux, but I'm getting NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX on Solaris. Has anyone used RXTX with serial over Ethernet devices? Any hints on how to make it work? I know that I'm not completely off track because javax.comm does work with Moxa on a Windows platform, but that's just not an option for production deployment. -- Jeff From tjarvi at qbang.org Sat Apr 19 21:08:41 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 19 Apr 2008 21:08:41 -0600 (MDT) Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: yOn Sat, 19 Apr 2008, Jeff Larsen wrote: > Hi all, > > I've been using javax.comm for years to communicate with a legacy > radio data system. We want to migrate the java side of the system to a > VMware Server virtual machine. We've had great success using Moxa > DE-303 and 5610 serial over Ethernet appliances and virtual machines > for running hylafax. The OS (Linux in this case) uses a kernel driver > to communicate with the Moxa via a virtual serial port such as > /dev/ttyr00. > > I want to do the same thing with javax.comm or gnu.io to connect to a > virtual serial port. However I'm hitting road blocks everywhere. > javax.comm for Linux sees the virtual port, but there are transmission > errors. Tried Solaris too, but the Solaris Moxa drivers don't play > nice with javax.comm because the driver uses /dev/pts/n instead of > /dev/term/x. Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris. > > Has anyone used RXTX with serial over Ethernet devices? Any hints on > how to make it work? > > I know that I'm not completely off track because javax.comm does work > with Moxa on a Windows platform, but that's just not an option for > production deployment. > > Moxa should work under linux. There may be minor issues depending upon how complete the kernel driver is but I think it will work. One of the minor issues is /dev/ttyr00 is not enumerated. There are several work arounds documented with the source code and on the wiki. The easiest solution for testing purposes is to make a symbolic link from /dev/ttyr00 to a port that is enumerated such as /dev/ttyS129. You can later alter the rxtx source or use properties to change the enumerated ports. -- Trent Jarvi tjarvi at qbang.org From d.tonhofer at m-plify.com Sun Apr 20 03:33:30 2008 From: d.tonhofer at m-plify.com (David Tonhofer (M-PLIFY S.A.)) Date: Sun, 20 Apr 2008 11:33:30 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: <480B0DEA.5010908@m-plify.com> Jeff Larsen wrote: > Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris It might be that the Java side of RXTX does not recognize that portname. Trying modifying src/RXTXCommDriver.java as described in this case: http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card From ajmas at sympatico.ca Sun Apr 20 16:37:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Apr 2008 18:37:59 -0400 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <480B0DEA.5010908@m-plify.com> References: <480B0DEA.5010908@m-plify.com> Message-ID: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > Jeff Larsen wrote: >> Next I tried RXTX on Linux, but I'm getting >> NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX >> on Solaris > It might be that the Java side of RXTX does not recognize that > portname. > Trying modifying src/RXTXCommDriver.java as described in this case: > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card I wonder whether it would be worth allowing custom port prefixes as a system parameter? For example: gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" Andre From Martin.Oberhuber at windriver.com Tue Apr 22 12:34:36 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 22 Apr 2008 20:34:36 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> References: <480B0DEA.5010908@m-plify.com> <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE6485848056CD6CE@ism-mail03.corp.ad.wrs.com> Sounds like a great idea... I'm wondering how the "variable part" after the Prefixes could be specified though? What about allowing Regular Expression character Classes in the existing System Property for specifying ports: System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyS[0-9],ttyS[ABC],ttyUSB[0-9a-z]"); The set of allowed patterns would of course need to Be restricted compared to REGEX, because it must be A syntax that supports iterating over it. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Montag, 21. April 2008 00:38 > To: rxtx at qbang.org and Users > Subject: Re: [Rxtx] Moxa serial over Ethernet driver > > > On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > > Jeff Larsen wrote: > >> Next I tried RXTX on Linux, but I'm getting > >> NoSuchPortException connecting to /dev/ttyr00. I have yet > to try RXTX > >> on Solaris > > It might be that the Java side of RXTX does not recognize that > > portname. > > Trying modifying src/RXTXCommDriver.java as described in this case: > > > > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_ > SST-4P.2FLP_multiport_card > > I wonder whether it would be worth allowing custom port > prefixes as a > system parameter? For > example: > > gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Loi.TRAN at weatherford.com Tue Apr 22 13:10:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Tue, 22 Apr 2008 14:10:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled Message-ID: Hi, I'm currently using the Java RXTX API to interface to a serial port. The serial port is connected to a bridge board that communicates with our communications system running at 1.875 Mbps which is linked to an embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no flow control). I send a command to the embedded board through the serial-bridge board which then is relayed to the embedded board. The command sent asks the embedded board to dump a binary image. Here's where I'm hitting some problems. I've successfully done this is an integrated serial port from the laptop. The binary file that comes back is consistent on every attempt. When I use the application I've written to do the same thing with a USB-to-serial adapter, the image I get back is not the same as the image I receive through the USB-to-serial adapter is not consistent at all. A final thing is that when I use a terminal program to dump the binary image with the USB-serial adapter, the image is correct. Every time! What is the terminal program doing that's not being done in my application? My application is quite simple. Has anyone observed this behavior before? If you have, I'd like to know how you've gotten around this problem. Thanks, LT =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From tjarvi at qbang.org Tue Apr 22 21:11:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 22 Apr 2008 21:11:10 -0600 (MDT) Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org From Loi.TRAN at weatherford.com Wed Apr 23 08:35:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Wed, 23 Apr 2008 09:35:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: Thanks for all the responses. I finally tried something that worked consistently. I updated my Prolific driver and repeated my tests. It worked. If you're using the Prolific type USB-serial adapters, do no use the Prolific version 2.0.2.1 driver on Windows. Update it to the latest 2.0.2.8 version. Again, thanks for all the responses. LT -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Tuesday, April 22, 2008 10:11 PM To: TRAN, Loi X. Cc: rxtx at qbang.org Subject: Re: [Rxtx] Prolific USB - RXTX data mangled On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From Martin.Oberhuber at windriver.com Wed Apr 23 18:54:26 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 02:54:26 +0200 Subject: [Rxtx] RXTX port locking on Linux status? Message-ID: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Dear RXTX community, I'm wondering what the status is with RXTX locking serial ports on Linux? My understanding is that the mechanism used in 2.1-7r2 (lockfiles) is not really state of the art, and has lots of problems (e.g. missing permissions). There was an idea to migrate towards a Kernel syscall based solution for port locking. What's the status here? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/9878db9f/attachment-0005.html From tjarvi at qbang.org Wed Apr 23 20:32:24 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Apr 2008 20:32:24 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > Dear RXTX community, > > I'm wondering what the status is with RXTX locking > serial ports on Linux? > > My understanding is that the mechanism used in > 2.1-7r2 (lockfiles) is not really state of the art, and > has lots of problems (e.g. missing permissions). > > There was an idea to migrate towards a Kernel > syscall based solution for port locking. > > What's the status here? > Hi Martin, I'm in favor of deprecating the current FHS locking mechanism in favor of an IOCTL when available. I think it will be available on all the platforms but do not know for sure. The status is unchanged. I've had very few free cycles for such things. Feel free to take a stab at it if you have some time. I believe the IOCTL is used in the Mac OS X code already. I don't see any real backwards compatability issues and the IOCTL should just work. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Apr 24 06:14:06 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 14:14:06 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Thanks Trent. Problem is only that I'm really not at all Familiar with the C part of RXTX. If there Were anything I could do in Java for this, It would be easier for me.... ... Are there any C experts here on the list Who'd like to look at ioctl port locking For linux? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Donnerstag, 24. April 2008 04:32 > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > I'm wondering what the status is with RXTX locking > > serial ports on Linux? > > > > My understanding is that the mechanism used in > > 2.1-7r2 (lockfiles) is not really state of the art, and > > has lots of problems (e.g. missing permissions). > > > > There was an idea to migrate towards a Kernel > > syscall based solution for port locking. > > > > What's the status here? > > > > Hi Martin, > > I'm in favor of deprecating the current FHS locking mechanism > in favor of > an IOCTL when available. I think it will be available on all the > platforms but do not know for sure. > > The status is unchanged. I've had very few free cycles for > such things. > Feel free to take a stab at it if you have some time. I > believe the IOCTL > is used in the Mac OS X code already. > > I don't see any real backwards compatability issues and the > IOCTL should > just work. > > -- > Trent Jarvi > tjarvi at qbang.org > From sspies at sloc.de Thu Apr 24 07:15:36 2008 From: sspies at sloc.de (Sebastian Spies) Date: Thu, 24 Apr 2008 15:15:36 +0200 (CEST) Subject: [Rxtx] rxtx on gumstix: Interrupted system call In-Reply-To: <47FB7B20.7080504@sloc.de> References: <47FB7B20.7080504@sloc.de> Message-ID: <55445.130.83.139.205.1209042936.squirrel@ssl.sloc.de> Dear list, while porting rxtx to the gumstix, I found out, that select used in readArray in SerialImp.c might not work as expected. Maybe, because of missing TIOCSERGETLSR-support? select is often interrupted, so i wrote the following quick'n'dirty hack to make it work on gumstix: diff -Nur rxtx-2.1-7r2/src/SerialImp.c rxtx-2.1-7r2/src/SerialImp.c --- rxtx-2.1-7r2/src/SerialImp.c 2006-01-29 23:19:04.000000000 +0100 +++ rxtx-2.1-7r2-patched/src/SerialImp.c 2008-04-24 14:30:17.000000000 +0200 @@ -3380,7 +3381,7 @@ JNIEXPORT jint JNICALL RXTXPort(readArray)( JNIEnv *env, jobject jobj, jbyteArray jbarray, jint offset, jint length ) { - int bytes; + int bytes = 0; jbyte *body; /* char msg[80]; */ int fd = get_java_var( env, jobj, "fd", "I" ); @@ -3397,9 +3398,18 @@ "readArray", "Invalid length" ); return -1; } - body = (*env)->GetByteArrayElements( env, jbarray, 0 ); - bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ - (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + while(1 > bytes) + { + body = (*env)->GetByteArrayElements( env, jbarray, 0 ); + bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ + (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + // quick'n'dirty - SSP + report (" trying again... \n"); + errno = 0; + } + if( bytes < 0 ) { report( "RXTXPort:readArray bytes < 0" ); LEAVE( "RXTXPort:readArray" ); > Hey, > > I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use > RXTXPort$SerialInputStream.read(), then I get the following Exception. I > did not yet figure out which system call is interrupted as strace > produces loads of output. > > Any help would be very appreciated. Thanks in advance. > Sebastian > > > [java] java.io.IOException: Interrupted system call in readArray > [java] at gnu.io.RXTXPort.readArray(Native Method) > [java] at > gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) > [java] at > java.io.FilterInputStream.read(FilterInputStream.java:189) > [java] at > java.io.BufferedInputStream.refill(BufferedInputStream.java:371) > [java] at > java.io.BufferedInputStream.read(BufferedInputStream.java:229) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) > [java] at > com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) > > -- > Sebastian Spies > > mail: sspies at sloc.de > > > > From fire_baptized at hotmail.com Thu Apr 24 18:27:48 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Thu, 24 Apr 2008 20:27:48 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hello I am having a problem with the serial device connecting (software wise) to the serial port. However I have a test program and it seems to work just fine in that environment - and it doesnt use GUI. The error I am getting is : PortNotFoundException Now the way I have it setup in the GUI environment is that once the user pushes a JButton the program connects using this class: protected void establishConnection() { try { portId = CommPortIdentifier.getPortIdentifier("COM3"); System.out.println("Establishing connction....."); messages[0] = "\nEstablishing connction.....\n"; } catch ( NoSuchPortException noport) { System.out.println("Port not found: "+ noport); messages[0] = "Port not found: "+ noport+"\n"; } try { serialPort = (SerialPort) portId.open("serial", 50); System.out.println("Port has been found."); messages[1] = "Port has been found.\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[1] = "" +usedport; } try { serialPort = (SerialPort) portId.open("serial", 50); messages[2] = "Connecting to COM3 on port 50....\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; } try { serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); System.out.println("Esablishing the transfer rate settings for COM3."); messages[3] = "Esablishing the transfer rate settings for COM3.\n"; } catch (UnsupportedCommOperationException nosupcom) { System.out.println(nosupcom); System.out.println("The tranfer rate could not be esblished on COM3."); messages[3] = "The tranfer rate could not be esblished on COM3.\n"; } System.out.println(serialPort.getFlowControlMode()); messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; //sendDataOut(buffer[3],buffer[4]); } I need all the data in this method (and all the string values in this method) to be printed out on a JTextArea. I wont do me any good if not all the text is printed on a JTextArea in another class. So I have the text printing the JTextArea correctly, but everytime the JButton is activated - it gives me that error message. I did add a disconnect button that is supposed to call the serialPort.close(). _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/273fd4ec/attachment-0004.html From tjarvi at qbang.org Thu Apr 24 21:54:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Apr 2008 21:54:10 -0600 (MDT) Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > Hello I am having a problem with the serial device connecting (software > wise) to the serial port. However I have a test program and it seems to > work just fine in that environment - and it doesnt use GUI. The error I > am getting is : PortNotFoundException Now the way I have it setup in the > GUI environment is that once the user pushes a JButton the program > connects using this class: > > protected void establishConnection() { > try { > portId = CommPortIdentifier.getPortIdentifier("COM3"); > System.out.println("Establishing connction....."); > messages[0] = "\nEstablishing connction.....\n"; > } > catch ( NoSuchPortException noport) { > System.out.println("Port not found: "+ noport); > messages[0] = "Port not found: "+ noport+"\n"; > } > try { > serialPort = (SerialPort) portId.open("serial", 50); > System.out.println("Port has been found."); > messages[1] = "Port has been found.\n"; > } > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[1] = "" +usedport; > } ================================================================= > try { > serialPort = (SerialPort) portId.open("serial", 50); > messages[2] = "Connecting to COM3 on port 50....\n"; > } ================================================================== > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > } > try { > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > System.out.println("Esablishing the transfer rate settings for COM3."); > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > } > catch (UnsupportedCommOperationException nosupcom) { > System.out.println(nosupcom); > System.out.println("The tranfer rate could not be esblished on COM3."); > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > } > System.out.println(serialPort.getFlowControlMode()); > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > //sendDataOut(buffer[3],buffer[4]); > } > > I need all the data in this method (and all the string values in this > method) to be printed out on a JTextArea. I wont do me any good if not > all the text is printed on a JTextArea in another class. So I have the > text printing the JTextArea correctly, but everytime the JButton is > activated - it gives me that error message. I did add a disconnect > button that is supposed to call the serialPort.close(). > The open code used twice is going to throw an exception. It may be that you catch the exception above this code and print a confusing message? A common mistake is people will accidently run two copies of their program. The first instance of the program will open the port and prevent enumeration (finding the port) in the second instance of the program. As an example, you may be running your text based application which is preventing the GUI from seeing the port. Enumeration is done by trying to open the port. If the port is open, Enumeration fails. -- Trent Jarvi tjarvi at qbang.org From fire_baptized at hotmail.com Thu Apr 24 22:32:05 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 00:32:05 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Wow - thanks dude what a dumb thing for me to not catch..... now here is the current problem - right now I am trying to output data again one is with the test program - and it seems that serialPort.setRTS(true); is throwing an exceptions there - now if I show this code please bare in mind that I am only testing - the code is kinda sloppy in my mind - but if I can figure out why calling this function is throwing an exception then maybe I can figure out why my GUI application is getting the same null pointer exceptions when try to send out the data stream. FYI Trent this email is not directed towards you - anyone can jump in on this public static void main(String args[]) { byte[] b = new byte[64]; int keyinput = 0 ; byte x = 0; byte y = 0; PortTesting1 testports = new PortTesting1(); try { joyskoro = Joystick.createInstance(); } catch (IOException ioexc) { System.out.println("There is an input/output problem: " + ioexc); } while (true) { joyskoro.poll(); b[0] = ((byte) -(10 * joyskoro.getY())); b[1] = ((byte) (10 * joyskoro.getX())); System.out.println("The 3rd byte is: " +b[0]); System.out.println("The 4rd byte is: " +b[1]); serialPort.setRTS(true); // HERE IS WHERE THE PROBLEM IS !!!!!!! ON THIS LINE but if I dont have it active in my program the Bluetooth device (that is System.out.println("Ready to send :-) !"); //connected to the serial port does not send out data!!!!! if (joyskoro.isButtonDown(joyskoro.BUTTON10)) { System.out.println("Connection terminated."); serialPort.close(); break; } if (joyskoro.isButtonDown(joyskoro.BUTTON2)) { boolean flag = true; //reading from key input from the keyboard System.out.println("Please input a command: "); while (flag) { try { keyinput = System.in.read(); } catch (IOException ioexc) {/*there is no need to put * anything here */ } if((char)keyinput=='w') { pushIt((byte)85); } if((char)keyinput=='s') { pushIt((byte)84); } if((char)keyinput=='a') { pushIt((byte)83); } if((char)keyinput=='d') { pushIt((byte)82); } if((char)keyinput=='q') { pushIt((byte)89); } if((char)keyinput=='\t') { //this stop reading input from the keyboard flag = false; } } and help anyways here is the block of code that throwing an exception for the test program: > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/5c8f7d68/attachment-0004.html From fire_baptized at hotmail.com Fri Apr 25 07:59:53 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 09:59:53 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Are there any examples of how to push out data? As in using input and output streams - if I can compare code maybe I can see where this is causing a problem. I have a byte array that I am pushing out data. I keep getting null pointer exceptions every where I turn. > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/22228ab6/attachment-0002.html From ajmas at sympatico.ca Sat Apr 26 07:37:09 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 26 Apr 2008 09:37:09 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hi, On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote: > > Are there any examples of how to push out data? As in using input > and output streams - if I can compare code maybe I can see where > this is causing a problem. I have a byte array that I am pushing > out data. I keep getting null pointer exceptions every where I turn. > There are some examples here that might be of help: http://rxtx.qbang.org/wiki/index.php/Examples Andre From fire_baptized at hotmail.com Sat Apr 26 20:13:54 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Sat, 26 Apr 2008 22:13:54 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: looked at those....yep didnt help - I need to push out data with GUI and not get a null pointer exception everytime I try. > CC: rxtx at qbang.org> From: ajmas at sympatico.ca> To: fire_baptized at hotmail.com> Subject: Re: [Rxtx] Serial Problems with Gui.....> Date: Sat, 26 Apr 2008 09:37:09 -0400> > Hi,> > > On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote:> >> > Are there any examples of how to push out data? As in using input > > and output streams - if I can compare code maybe I can see where > > this is causing a problem. I have a byte array that I am pushing > > out data. I keep getting null pointer exceptions every where I turn.> >> > There are some examples here that might be of help:> > http://rxtx.qbang.org/wiki/index.php/Examples> > Andre _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080426/09f95b41/attachment-0001.html From michael.erskine at ketech.com Mon Apr 28 02:47:22 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 28 Apr 2008 09:47:22 +0100 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D426EF3CBBC5@no-sv-03.ketech.local> Jesrael D. Summerhill wrote: > looked at those....yep didnt help - I need to push out data with GUI and > not get a null pointer exception everytime I try. So it seems pretty obvious that your code needs to check for nulls wherever one may occur and report what's happening. Alternatively, catch the npe and display the stack trace. Then you can fix your code so it doesn't try to work with something that ain't there. Regards, Michael Erskine. From scldad at sdc.com.au Mon Apr 28 03:58:34 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Mon, 28 Apr 2008 19:28:34 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Message-ID: <200804281928.34454.scldad@sdc.com.au> Has anybody done any design work on this? The first thing that springs to mind is that we still need to check for lock files because other apps tend to use that approach even if we go to ioctl. Cheers, Stephen Davies On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > Thanks Trent. > > Problem is only that I'm really not at all > Familiar with the C part of RXTX. If there > Were anything I could do in Java for this, > It would be easier for me.... > > ... Are there any C experts here on the list > Who'd like to look at ioctl port locking > For linux? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > -----Original Message----- > > From: Trent Jarvi [mailto:tjarvi at qbang.org] > > Sent: Donnerstag, 24. April 2008 04:32 > > To: Oberhuber, Martin > > Cc: rxtx at qbang.org > > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > > > I'm wondering what the status is with RXTX locking > > > serial ports on Linux? > > > > > > My understanding is that the mechanism used in > > > 2.1-7r2 (lockfiles) is not really state of the art, and > > > has lots of problems (e.g. missing permissions). > > > > > > There was an idea to migrate towards a Kernel > > > syscall based solution for port locking. > > > > > > What's the status here? > > > > Hi Martin, > > > > I'm in favor of deprecating the current FHS locking mechanism > > in favor of > > an IOCTL when available. I think it will be available on all the > > platforms but do not know for sure. > > > > The status is unchanged. I've had very few free cycles for > > such things. > > Feel free to take a stab at it if you have some time. I > > believe the IOCTL > > is used in the Mac OS X code already. > > > > I don't see any real backwards compatability issues and the > > IOCTL should > > just work. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Mon Apr 28 04:21:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 28 Apr 2008 04:21:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804281928.34454.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: I don't think there would need to be any architectural changes. A couple ifdefs and minor changes in the current code should be enough. Proposal: FHS/UUCP locks: continue to respect them, try to create them but do not error if the IOCTL is supported. (But does the IOCTL being defined mean it will work?) Enumeration: Do not assert the IOCTL while opening. Serial.open: assert the IOCTL after open. Continue to use locks as described above after asserting the IOCTL. If the IOCTL is defined but not working, handle it here. Failure cases include the IOCTL is not supported and the port is already locked. On Mon, 28 Apr 2008, Stephen Davies wrote: > Has anybody done any design work on this? > The first thing that springs to mind is that we still need to check for lock > files because other apps tend to use that approach even if we go to ioctl. > > Cheers, > Stephen Davies > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: >> Thanks Trent. >> >> Problem is only that I'm really not at all >> Familiar with the C part of RXTX. If there >> Were anything I could do in Java for this, >> It would be easier for me.... >> >> ... Are there any C experts here on the list >> Who'd like to look at ioctl port locking >> For linux? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >>> -----Original Message----- >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] >>> Sent: Donnerstag, 24. April 2008 04:32 >>> To: Oberhuber, Martin >>> Cc: rxtx at qbang.org >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? >>> >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: >>>> Dear RXTX community, >>>> >>>> I'm wondering what the status is with RXTX locking >>>> serial ports on Linux? >>>> >>>> My understanding is that the mechanism used in >>>> 2.1-7r2 (lockfiles) is not really state of the art, and >>>> has lots of problems (e.g. missing permissions). >>>> >>>> There was an idea to migrate towards a Kernel >>>> syscall based solution for port locking. >>>> >>>> What's the status here? >>> >>> Hi Martin, >>> >>> I'm in favor of deprecating the current FHS locking mechanism >>> in favor of >>> an IOCTL when available. I think it will be available on all the >>> platforms but do not know for sure. >>> >>> The status is unchanged. I've had very few free cycles for >>> such things. >>> Feel free to take a stab at it if you have some time. I >>> believe the IOCTL >>> is used in the Mac OS X code already. >>> >>> I don't see any real backwards compatability issues and the >>> IOCTL should >>> just work. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0028.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0026.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0013.html From pboulton at pulsetracer.com Fri Apr 18 14:30:13 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Fri, 18 Apr 2008 13:30:13 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site Message-ID: <480904D5.1060307@pulsetracer.com> Hello, gentle serial porters. I have downloaded the zipped up binaries for use on Windows without Sun's CommAPI, but don't seem able to extract anything from the download. Go to main page, http://www.rxtx.org/ Click on Downloads I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) And I save it to disk. If I try and extract the files with WinZip, Winzip thinks the archive is corrupt. If I try using Windows Explorer, I am able to extract it into a single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than the original .zip. Any help would be much appreciated. Sincerely, Philip Boulton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080418/97d89793/attachment-0011.html From tjarvi at qbang.org Fri Apr 18 19:07:00 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 18 Apr 2008 19:07:00 -0600 (MDT) Subject: [Rxtx] Difficulty opening zip file at rxtx site In-Reply-To: <480904D5.1060307@pulsetracer.com> References: <480904D5.1060307@pulsetracer.com> Message-ID: On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org From pboulton at pulsetracer.com Sat Apr 19 12:46:26 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Sat, 19 Apr 2008 11:46:26 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site References: <480904D5.1060307@pulsetracer.com> Message-ID: <53DB7576450695419E09299104043761A78533@ZTGSERVER.ztg.local> I have been able to get my hands on the binaries, by going to the ftp directory /pub/rxtx at ftp.qbang.org,, and ftping the file rxtx-2.1-7-bins-r2.zip . This opens happily with Winzip, and extracts as the set of files that you describe below. I only experience the ill-formed archive problem by clicking the link on the rxtx.org Downloads page (http://rxtx.qbang.org/pub/rxtx/ rxtx-2.1-7-bins-r2.zip ). Not sure what to make of that. Philip Boulton ________________________________ From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Fri 4/18/2008 6:07 PM To: Philip Boulton Cc: rxtx at qbang.org Subject: Re: [Rxtx] Difficulty opening zip file at rxtx site On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080419/147923bb/attachment-0010.html From jlar310 at gmail.com Sat Apr 19 19:11:55 2008 From: jlar310 at gmail.com (Jeff Larsen) Date: Sat, 19 Apr 2008 20:11:55 -0500 Subject: [Rxtx] Moxa serial over Ethernet driver Message-ID: Hi all, I've been using javax.comm for years to communicate with a legacy radio data system. We want to migrate the java side of the system to a VMware Server virtual machine. We've had great success using Moxa DE-303 and 5610 serial over Ethernet appliances and virtual machines for running hylafax. The OS (Linux in this case) uses a kernel driver to communicate with the Moxa via a virtual serial port such as /dev/ttyr00. I want to do the same thing with javax.comm or gnu.io to connect to a virtual serial port. However I'm hitting road blocks everywhere. javax.comm for Linux sees the virtual port, but there are transmission errors. Tried Solaris too, but the Solaris Moxa drivers don't play nice with javax.comm because the driver uses /dev/pts/n instead of /dev/term/x. Next I tried RXTX on Linux, but I'm getting NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX on Solaris. Has anyone used RXTX with serial over Ethernet devices? Any hints on how to make it work? I know that I'm not completely off track because javax.comm does work with Moxa on a Windows platform, but that's just not an option for production deployment. -- Jeff From tjarvi at qbang.org Sat Apr 19 21:08:41 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 19 Apr 2008 21:08:41 -0600 (MDT) Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: yOn Sat, 19 Apr 2008, Jeff Larsen wrote: > Hi all, > > I've been using javax.comm for years to communicate with a legacy > radio data system. We want to migrate the java side of the system to a > VMware Server virtual machine. We've had great success using Moxa > DE-303 and 5610 serial over Ethernet appliances and virtual machines > for running hylafax. The OS (Linux in this case) uses a kernel driver > to communicate with the Moxa via a virtual serial port such as > /dev/ttyr00. > > I want to do the same thing with javax.comm or gnu.io to connect to a > virtual serial port. However I'm hitting road blocks everywhere. > javax.comm for Linux sees the virtual port, but there are transmission > errors. Tried Solaris too, but the Solaris Moxa drivers don't play > nice with javax.comm because the driver uses /dev/pts/n instead of > /dev/term/x. Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris. > > Has anyone used RXTX with serial over Ethernet devices? Any hints on > how to make it work? > > I know that I'm not completely off track because javax.comm does work > with Moxa on a Windows platform, but that's just not an option for > production deployment. > > Moxa should work under linux. There may be minor issues depending upon how complete the kernel driver is but I think it will work. One of the minor issues is /dev/ttyr00 is not enumerated. There are several work arounds documented with the source code and on the wiki. The easiest solution for testing purposes is to make a symbolic link from /dev/ttyr00 to a port that is enumerated such as /dev/ttyS129. You can later alter the rxtx source or use properties to change the enumerated ports. -- Trent Jarvi tjarvi at qbang.org From d.tonhofer at m-plify.com Sun Apr 20 03:33:30 2008 From: d.tonhofer at m-plify.com (David Tonhofer (M-PLIFY S.A.)) Date: Sun, 20 Apr 2008 11:33:30 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: <480B0DEA.5010908@m-plify.com> Jeff Larsen wrote: > Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris It might be that the Java side of RXTX does not recognize that portname. Trying modifying src/RXTXCommDriver.java as described in this case: http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card From ajmas at sympatico.ca Sun Apr 20 16:37:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Apr 2008 18:37:59 -0400 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <480B0DEA.5010908@m-plify.com> References: <480B0DEA.5010908@m-plify.com> Message-ID: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > Jeff Larsen wrote: >> Next I tried RXTX on Linux, but I'm getting >> NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX >> on Solaris > It might be that the Java side of RXTX does not recognize that > portname. > Trying modifying src/RXTXCommDriver.java as described in this case: > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card I wonder whether it would be worth allowing custom port prefixes as a system parameter? For example: gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" Andre From Martin.Oberhuber at windriver.com Tue Apr 22 12:34:36 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 22 Apr 2008 20:34:36 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> References: <480B0DEA.5010908@m-plify.com> <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE6485848056CD6CE@ism-mail03.corp.ad.wrs.com> Sounds like a great idea... I'm wondering how the "variable part" after the Prefixes could be specified though? What about allowing Regular Expression character Classes in the existing System Property for specifying ports: System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyS[0-9],ttyS[ABC],ttyUSB[0-9a-z]"); The set of allowed patterns would of course need to Be restricted compared to REGEX, because it must be A syntax that supports iterating over it. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Montag, 21. April 2008 00:38 > To: rxtx at qbang.org and Users > Subject: Re: [Rxtx] Moxa serial over Ethernet driver > > > On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > > Jeff Larsen wrote: > >> Next I tried RXTX on Linux, but I'm getting > >> NoSuchPortException connecting to /dev/ttyr00. I have yet > to try RXTX > >> on Solaris > > It might be that the Java side of RXTX does not recognize that > > portname. > > Trying modifying src/RXTXCommDriver.java as described in this case: > > > > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_ > SST-4P.2FLP_multiport_card > > I wonder whether it would be worth allowing custom port > prefixes as a > system parameter? For > example: > > gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Loi.TRAN at weatherford.com Tue Apr 22 13:10:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Tue, 22 Apr 2008 14:10:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled Message-ID: Hi, I'm currently using the Java RXTX API to interface to a serial port. The serial port is connected to a bridge board that communicates with our communications system running at 1.875 Mbps which is linked to an embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no flow control). I send a command to the embedded board through the serial-bridge board which then is relayed to the embedded board. The command sent asks the embedded board to dump a binary image. Here's where I'm hitting some problems. I've successfully done this is an integrated serial port from the laptop. The binary file that comes back is consistent on every attempt. When I use the application I've written to do the same thing with a USB-to-serial adapter, the image I get back is not the same as the image I receive through the USB-to-serial adapter is not consistent at all. A final thing is that when I use a terminal program to dump the binary image with the USB-serial adapter, the image is correct. Every time! What is the terminal program doing that's not being done in my application? My application is quite simple. Has anyone observed this behavior before? If you have, I'd like to know how you've gotten around this problem. Thanks, LT =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From tjarvi at qbang.org Tue Apr 22 21:11:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 22 Apr 2008 21:11:10 -0600 (MDT) Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org From Loi.TRAN at weatherford.com Wed Apr 23 08:35:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Wed, 23 Apr 2008 09:35:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: Thanks for all the responses. I finally tried something that worked consistently. I updated my Prolific driver and repeated my tests. It worked. If you're using the Prolific type USB-serial adapters, do no use the Prolific version 2.0.2.1 driver on Windows. Update it to the latest 2.0.2.8 version. Again, thanks for all the responses. LT -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Tuesday, April 22, 2008 10:11 PM To: TRAN, Loi X. Cc: rxtx at qbang.org Subject: Re: [Rxtx] Prolific USB - RXTX data mangled On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From Martin.Oberhuber at windriver.com Wed Apr 23 18:54:26 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 02:54:26 +0200 Subject: [Rxtx] RXTX port locking on Linux status? Message-ID: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Dear RXTX community, I'm wondering what the status is with RXTX locking serial ports on Linux? My understanding is that the mechanism used in 2.1-7r2 (lockfiles) is not really state of the art, and has lots of problems (e.g. missing permissions). There was an idea to migrate towards a Kernel syscall based solution for port locking. What's the status here? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/9878db9f/attachment-0006.html From tjarvi at qbang.org Wed Apr 23 20:32:24 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Apr 2008 20:32:24 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > Dear RXTX community, > > I'm wondering what the status is with RXTX locking > serial ports on Linux? > > My understanding is that the mechanism used in > 2.1-7r2 (lockfiles) is not really state of the art, and > has lots of problems (e.g. missing permissions). > > There was an idea to migrate towards a Kernel > syscall based solution for port locking. > > What's the status here? > Hi Martin, I'm in favor of deprecating the current FHS locking mechanism in favor of an IOCTL when available. I think it will be available on all the platforms but do not know for sure. The status is unchanged. I've had very few free cycles for such things. Feel free to take a stab at it if you have some time. I believe the IOCTL is used in the Mac OS X code already. I don't see any real backwards compatability issues and the IOCTL should just work. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Apr 24 06:14:06 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 14:14:06 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Thanks Trent. Problem is only that I'm really not at all Familiar with the C part of RXTX. If there Were anything I could do in Java for this, It would be easier for me.... ... Are there any C experts here on the list Who'd like to look at ioctl port locking For linux? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Donnerstag, 24. April 2008 04:32 > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > I'm wondering what the status is with RXTX locking > > serial ports on Linux? > > > > My understanding is that the mechanism used in > > 2.1-7r2 (lockfiles) is not really state of the art, and > > has lots of problems (e.g. missing permissions). > > > > There was an idea to migrate towards a Kernel > > syscall based solution for port locking. > > > > What's the status here? > > > > Hi Martin, > > I'm in favor of deprecating the current FHS locking mechanism > in favor of > an IOCTL when available. I think it will be available on all the > platforms but do not know for sure. > > The status is unchanged. I've had very few free cycles for > such things. > Feel free to take a stab at it if you have some time. I > believe the IOCTL > is used in the Mac OS X code already. > > I don't see any real backwards compatability issues and the > IOCTL should > just work. > > -- > Trent Jarvi > tjarvi at qbang.org > From sspies at sloc.de Thu Apr 24 07:15:36 2008 From: sspies at sloc.de (Sebastian Spies) Date: Thu, 24 Apr 2008 15:15:36 +0200 (CEST) Subject: [Rxtx] rxtx on gumstix: Interrupted system call In-Reply-To: <47FB7B20.7080504@sloc.de> References: <47FB7B20.7080504@sloc.de> Message-ID: <55445.130.83.139.205.1209042936.squirrel@ssl.sloc.de> Dear list, while porting rxtx to the gumstix, I found out, that select used in readArray in SerialImp.c might not work as expected. Maybe, because of missing TIOCSERGETLSR-support? select is often interrupted, so i wrote the following quick'n'dirty hack to make it work on gumstix: diff -Nur rxtx-2.1-7r2/src/SerialImp.c rxtx-2.1-7r2/src/SerialImp.c --- rxtx-2.1-7r2/src/SerialImp.c 2006-01-29 23:19:04.000000000 +0100 +++ rxtx-2.1-7r2-patched/src/SerialImp.c 2008-04-24 14:30:17.000000000 +0200 @@ -3380,7 +3381,7 @@ JNIEXPORT jint JNICALL RXTXPort(readArray)( JNIEnv *env, jobject jobj, jbyteArray jbarray, jint offset, jint length ) { - int bytes; + int bytes = 0; jbyte *body; /* char msg[80]; */ int fd = get_java_var( env, jobj, "fd", "I" ); @@ -3397,9 +3398,18 @@ "readArray", "Invalid length" ); return -1; } - body = (*env)->GetByteArrayElements( env, jbarray, 0 ); - bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ - (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + while(1 > bytes) + { + body = (*env)->GetByteArrayElements( env, jbarray, 0 ); + bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ + (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + // quick'n'dirty - SSP + report (" trying again... \n"); + errno = 0; + } + if( bytes < 0 ) { report( "RXTXPort:readArray bytes < 0" ); LEAVE( "RXTXPort:readArray" ); > Hey, > > I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use > RXTXPort$SerialInputStream.read(), then I get the following Exception. I > did not yet figure out which system call is interrupted as strace > produces loads of output. > > Any help would be very appreciated. Thanks in advance. > Sebastian > > > [java] java.io.IOException: Interrupted system call in readArray > [java] at gnu.io.RXTXPort.readArray(Native Method) > [java] at > gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) > [java] at > java.io.FilterInputStream.read(FilterInputStream.java:189) > [java] at > java.io.BufferedInputStream.refill(BufferedInputStream.java:371) > [java] at > java.io.BufferedInputStream.read(BufferedInputStream.java:229) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) > [java] at > com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) > > -- > Sebastian Spies > > mail: sspies at sloc.de > > > > From fire_baptized at hotmail.com Thu Apr 24 18:27:48 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Thu, 24 Apr 2008 20:27:48 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hello I am having a problem with the serial device connecting (software wise) to the serial port. However I have a test program and it seems to work just fine in that environment - and it doesnt use GUI. The error I am getting is : PortNotFoundException Now the way I have it setup in the GUI environment is that once the user pushes a JButton the program connects using this class: protected void establishConnection() { try { portId = CommPortIdentifier.getPortIdentifier("COM3"); System.out.println("Establishing connction....."); messages[0] = "\nEstablishing connction.....\n"; } catch ( NoSuchPortException noport) { System.out.println("Port not found: "+ noport); messages[0] = "Port not found: "+ noport+"\n"; } try { serialPort = (SerialPort) portId.open("serial", 50); System.out.println("Port has been found."); messages[1] = "Port has been found.\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[1] = "" +usedport; } try { serialPort = (SerialPort) portId.open("serial", 50); messages[2] = "Connecting to COM3 on port 50....\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; } try { serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); System.out.println("Esablishing the transfer rate settings for COM3."); messages[3] = "Esablishing the transfer rate settings for COM3.\n"; } catch (UnsupportedCommOperationException nosupcom) { System.out.println(nosupcom); System.out.println("The tranfer rate could not be esblished on COM3."); messages[3] = "The tranfer rate could not be esblished on COM3.\n"; } System.out.println(serialPort.getFlowControlMode()); messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; //sendDataOut(buffer[3],buffer[4]); } I need all the data in this method (and all the string values in this method) to be printed out on a JTextArea. I wont do me any good if not all the text is printed on a JTextArea in another class. So I have the text printing the JTextArea correctly, but everytime the JButton is activated - it gives me that error message. I did add a disconnect button that is supposed to call the serialPort.close(). _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/273fd4ec/attachment-0005.html From tjarvi at qbang.org Thu Apr 24 21:54:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Apr 2008 21:54:10 -0600 (MDT) Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > Hello I am having a problem with the serial device connecting (software > wise) to the serial port. However I have a test program and it seems to > work just fine in that environment - and it doesnt use GUI. The error I > am getting is : PortNotFoundException Now the way I have it setup in the > GUI environment is that once the user pushes a JButton the program > connects using this class: > > protected void establishConnection() { > try { > portId = CommPortIdentifier.getPortIdentifier("COM3"); > System.out.println("Establishing connction....."); > messages[0] = "\nEstablishing connction.....\n"; > } > catch ( NoSuchPortException noport) { > System.out.println("Port not found: "+ noport); > messages[0] = "Port not found: "+ noport+"\n"; > } > try { > serialPort = (SerialPort) portId.open("serial", 50); > System.out.println("Port has been found."); > messages[1] = "Port has been found.\n"; > } > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[1] = "" +usedport; > } ================================================================= > try { > serialPort = (SerialPort) portId.open("serial", 50); > messages[2] = "Connecting to COM3 on port 50....\n"; > } ================================================================== > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > } > try { > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > System.out.println("Esablishing the transfer rate settings for COM3."); > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > } > catch (UnsupportedCommOperationException nosupcom) { > System.out.println(nosupcom); > System.out.println("The tranfer rate could not be esblished on COM3."); > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > } > System.out.println(serialPort.getFlowControlMode()); > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > //sendDataOut(buffer[3],buffer[4]); > } > > I need all the data in this method (and all the string values in this > method) to be printed out on a JTextArea. I wont do me any good if not > all the text is printed on a JTextArea in another class. So I have the > text printing the JTextArea correctly, but everytime the JButton is > activated - it gives me that error message. I did add a disconnect > button that is supposed to call the serialPort.close(). > The open code used twice is going to throw an exception. It may be that you catch the exception above this code and print a confusing message? A common mistake is people will accidently run two copies of their program. The first instance of the program will open the port and prevent enumeration (finding the port) in the second instance of the program. As an example, you may be running your text based application which is preventing the GUI from seeing the port. Enumeration is done by trying to open the port. If the port is open, Enumeration fails. -- Trent Jarvi tjarvi at qbang.org From fire_baptized at hotmail.com Thu Apr 24 22:32:05 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 00:32:05 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Wow - thanks dude what a dumb thing for me to not catch..... now here is the current problem - right now I am trying to output data again one is with the test program - and it seems that serialPort.setRTS(true); is throwing an exceptions there - now if I show this code please bare in mind that I am only testing - the code is kinda sloppy in my mind - but if I can figure out why calling this function is throwing an exception then maybe I can figure out why my GUI application is getting the same null pointer exceptions when try to send out the data stream. FYI Trent this email is not directed towards you - anyone can jump in on this public static void main(String args[]) { byte[] b = new byte[64]; int keyinput = 0 ; byte x = 0; byte y = 0; PortTesting1 testports = new PortTesting1(); try { joyskoro = Joystick.createInstance(); } catch (IOException ioexc) { System.out.println("There is an input/output problem: " + ioexc); } while (true) { joyskoro.poll(); b[0] = ((byte) -(10 * joyskoro.getY())); b[1] = ((byte) (10 * joyskoro.getX())); System.out.println("The 3rd byte is: " +b[0]); System.out.println("The 4rd byte is: " +b[1]); serialPort.setRTS(true); // HERE IS WHERE THE PROBLEM IS !!!!!!! ON THIS LINE but if I dont have it active in my program the Bluetooth device (that is System.out.println("Ready to send :-) !"); //connected to the serial port does not send out data!!!!! if (joyskoro.isButtonDown(joyskoro.BUTTON10)) { System.out.println("Connection terminated."); serialPort.close(); break; } if (joyskoro.isButtonDown(joyskoro.BUTTON2)) { boolean flag = true; //reading from key input from the keyboard System.out.println("Please input a command: "); while (flag) { try { keyinput = System.in.read(); } catch (IOException ioexc) {/*there is no need to put * anything here */ } if((char)keyinput=='w') { pushIt((byte)85); } if((char)keyinput=='s') { pushIt((byte)84); } if((char)keyinput=='a') { pushIt((byte)83); } if((char)keyinput=='d') { pushIt((byte)82); } if((char)keyinput=='q') { pushIt((byte)89); } if((char)keyinput=='\t') { //this stop reading input from the keyboard flag = false; } } and help anyways here is the block of code that throwing an exception for the test program: > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/5c8f7d68/attachment-0005.html From fire_baptized at hotmail.com Fri Apr 25 07:59:53 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 09:59:53 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Are there any examples of how to push out data? As in using input and output streams - if I can compare code maybe I can see where this is causing a problem. I have a byte array that I am pushing out data. I keep getting null pointer exceptions every where I turn. > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/22228ab6/attachment-0004.html From ajmas at sympatico.ca Sat Apr 26 07:37:09 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 26 Apr 2008 09:37:09 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hi, On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote: > > Are there any examples of how to push out data? As in using input > and output streams - if I can compare code maybe I can see where > this is causing a problem. I have a byte array that I am pushing > out data. I keep getting null pointer exceptions every where I turn. > There are some examples here that might be of help: http://rxtx.qbang.org/wiki/index.php/Examples Andre From fire_baptized at hotmail.com Sat Apr 26 20:13:54 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Sat, 26 Apr 2008 22:13:54 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: looked at those....yep didnt help - I need to push out data with GUI and not get a null pointer exception everytime I try. > CC: rxtx at qbang.org> From: ajmas at sympatico.ca> To: fire_baptized at hotmail.com> Subject: Re: [Rxtx] Serial Problems with Gui.....> Date: Sat, 26 Apr 2008 09:37:09 -0400> > Hi,> > > On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote:> >> > Are there any examples of how to push out data? As in using input > > and output streams - if I can compare code maybe I can see where > > this is causing a problem. I have a byte array that I am pushing > > out data. I keep getting null pointer exceptions every where I turn.> >> > There are some examples here that might be of help:> > http://rxtx.qbang.org/wiki/index.php/Examples> > Andre _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080426/09f95b41/attachment-0003.html From michael.erskine at ketech.com Mon Apr 28 02:47:22 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 28 Apr 2008 09:47:22 +0100 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D426EF3CBBC5@no-sv-03.ketech.local> Jesrael D. Summerhill wrote: > looked at those....yep didnt help - I need to push out data with GUI and > not get a null pointer exception everytime I try. So it seems pretty obvious that your code needs to check for nulls wherever one may occur and report what's happening. Alternatively, catch the npe and display the stack trace. Then you can fix your code so it doesn't try to work with something that ain't there. Regards, Michael Erskine. From scldad at sdc.com.au Mon Apr 28 03:58:34 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Mon, 28 Apr 2008 19:28:34 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Message-ID: <200804281928.34454.scldad@sdc.com.au> Has anybody done any design work on this? The first thing that springs to mind is that we still need to check for lock files because other apps tend to use that approach even if we go to ioctl. Cheers, Stephen Davies On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > Thanks Trent. > > Problem is only that I'm really not at all > Familiar with the C part of RXTX. If there > Were anything I could do in Java for this, > It would be easier for me.... > > ... Are there any C experts here on the list > Who'd like to look at ioctl port locking > For linux? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > -----Original Message----- > > From: Trent Jarvi [mailto:tjarvi at qbang.org] > > Sent: Donnerstag, 24. April 2008 04:32 > > To: Oberhuber, Martin > > Cc: rxtx at qbang.org > > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > > > I'm wondering what the status is with RXTX locking > > > serial ports on Linux? > > > > > > My understanding is that the mechanism used in > > > 2.1-7r2 (lockfiles) is not really state of the art, and > > > has lots of problems (e.g. missing permissions). > > > > > > There was an idea to migrate towards a Kernel > > > syscall based solution for port locking. > > > > > > What's the status here? > > > > Hi Martin, > > > > I'm in favor of deprecating the current FHS locking mechanism > > in favor of > > an IOCTL when available. I think it will be available on all the > > platforms but do not know for sure. > > > > The status is unchanged. I've had very few free cycles for > > such things. > > Feel free to take a stab at it if you have some time. I > > believe the IOCTL > > is used in the Mac OS X code already. > > > > I don't see any real backwards compatability issues and the > > IOCTL should > > just work. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Mon Apr 28 04:21:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 28 Apr 2008 04:21:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804281928.34454.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: I don't think there would need to be any architectural changes. A couple ifdefs and minor changes in the current code should be enough. Proposal: FHS/UUCP locks: continue to respect them, try to create them but do not error if the IOCTL is supported. (But does the IOCTL being defined mean it will work?) Enumeration: Do not assert the IOCTL while opening. Serial.open: assert the IOCTL after open. Continue to use locks as described above after asserting the IOCTL. If the IOCTL is defined but not working, handle it here. Failure cases include the IOCTL is not supported and the port is already locked. On Mon, 28 Apr 2008, Stephen Davies wrote: > Has anybody done any design work on this? > The first thing that springs to mind is that we still need to check for lock > files because other apps tend to use that approach even if we go to ioctl. > > Cheers, > Stephen Davies > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: >> Thanks Trent. >> >> Problem is only that I'm really not at all >> Familiar with the C part of RXTX. If there >> Were anything I could do in Java for this, >> It would be easier for me.... >> >> ... Are there any C experts here on the list >> Who'd like to look at ioctl port locking >> For linux? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >>> -----Original Message----- >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] >>> Sent: Donnerstag, 24. April 2008 04:32 >>> To: Oberhuber, Martin >>> Cc: rxtx at qbang.org >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? >>> >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: >>>> Dear RXTX community, >>>> >>>> I'm wondering what the status is with RXTX locking >>>> serial ports on Linux? >>>> >>>> My understanding is that the mechanism used in >>>> 2.1-7r2 (lockfiles) is not really state of the art, and >>>> has lots of problems (e.g. missing permissions). >>>> >>>> There was an idea to migrate towards a Kernel >>>> syscall based solution for port locking. >>>> >>>> What's the status here? >>> >>> Hi Martin, >>> >>> I'm in favor of deprecating the current FHS locking mechanism >>> in favor of >>> an IOCTL when available. I think it will be available on all the >>> platforms but do not know for sure. >>> >>> The status is unchanged. I've had very few free cycles for >>> such things. >>> Feel free to take a stab at it if you have some time. I >>> believe the IOCTL >>> is used in the Mac OS X code already. >>> >>> I don't see any real backwards compatability issues and the >>> IOCTL should >>> just work. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0029.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0027.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0014.html From pboulton at pulsetracer.com Fri Apr 18 14:30:13 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Fri, 18 Apr 2008 13:30:13 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site Message-ID: <480904D5.1060307@pulsetracer.com> Hello, gentle serial porters. I have downloaded the zipped up binaries for use on Windows without Sun's CommAPI, but don't seem able to extract anything from the download. Go to main page, http://www.rxtx.org/ Click on Downloads I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) And I save it to disk. If I try and extract the files with WinZip, Winzip thinks the archive is corrupt. If I try using Windows Explorer, I am able to extract it into a single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than the original .zip. Any help would be much appreciated. Sincerely, Philip Boulton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080418/97d89793/attachment-0012.html From tjarvi at qbang.org Fri Apr 18 19:07:00 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 18 Apr 2008 19:07:00 -0600 (MDT) Subject: [Rxtx] Difficulty opening zip file at rxtx site In-Reply-To: <480904D5.1060307@pulsetracer.com> References: <480904D5.1060307@pulsetracer.com> Message-ID: On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org From pboulton at pulsetracer.com Sat Apr 19 12:46:26 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Sat, 19 Apr 2008 11:46:26 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site References: <480904D5.1060307@pulsetracer.com> Message-ID: <53DB7576450695419E09299104043761A78533@ZTGSERVER.ztg.local> I have been able to get my hands on the binaries, by going to the ftp directory /pub/rxtx at ftp.qbang.org,, and ftping the file rxtx-2.1-7-bins-r2.zip . This opens happily with Winzip, and extracts as the set of files that you describe below. I only experience the ill-formed archive problem by clicking the link on the rxtx.org Downloads page (http://rxtx.qbang.org/pub/rxtx/ rxtx-2.1-7-bins-r2.zip ). Not sure what to make of that. Philip Boulton ________________________________ From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Fri 4/18/2008 6:07 PM To: Philip Boulton Cc: rxtx at qbang.org Subject: Re: [Rxtx] Difficulty opening zip file at rxtx site On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080419/147923bb/attachment-0011.html From jlar310 at gmail.com Sat Apr 19 19:11:55 2008 From: jlar310 at gmail.com (Jeff Larsen) Date: Sat, 19 Apr 2008 20:11:55 -0500 Subject: [Rxtx] Moxa serial over Ethernet driver Message-ID: Hi all, I've been using javax.comm for years to communicate with a legacy radio data system. We want to migrate the java side of the system to a VMware Server virtual machine. We've had great success using Moxa DE-303 and 5610 serial over Ethernet appliances and virtual machines for running hylafax. The OS (Linux in this case) uses a kernel driver to communicate with the Moxa via a virtual serial port such as /dev/ttyr00. I want to do the same thing with javax.comm or gnu.io to connect to a virtual serial port. However I'm hitting road blocks everywhere. javax.comm for Linux sees the virtual port, but there are transmission errors. Tried Solaris too, but the Solaris Moxa drivers don't play nice with javax.comm because the driver uses /dev/pts/n instead of /dev/term/x. Next I tried RXTX on Linux, but I'm getting NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX on Solaris. Has anyone used RXTX with serial over Ethernet devices? Any hints on how to make it work? I know that I'm not completely off track because javax.comm does work with Moxa on a Windows platform, but that's just not an option for production deployment. -- Jeff From tjarvi at qbang.org Sat Apr 19 21:08:41 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 19 Apr 2008 21:08:41 -0600 (MDT) Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: yOn Sat, 19 Apr 2008, Jeff Larsen wrote: > Hi all, > > I've been using javax.comm for years to communicate with a legacy > radio data system. We want to migrate the java side of the system to a > VMware Server virtual machine. We've had great success using Moxa > DE-303 and 5610 serial over Ethernet appliances and virtual machines > for running hylafax. The OS (Linux in this case) uses a kernel driver > to communicate with the Moxa via a virtual serial port such as > /dev/ttyr00. > > I want to do the same thing with javax.comm or gnu.io to connect to a > virtual serial port. However I'm hitting road blocks everywhere. > javax.comm for Linux sees the virtual port, but there are transmission > errors. Tried Solaris too, but the Solaris Moxa drivers don't play > nice with javax.comm because the driver uses /dev/pts/n instead of > /dev/term/x. Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris. > > Has anyone used RXTX with serial over Ethernet devices? Any hints on > how to make it work? > > I know that I'm not completely off track because javax.comm does work > with Moxa on a Windows platform, but that's just not an option for > production deployment. > > Moxa should work under linux. There may be minor issues depending upon how complete the kernel driver is but I think it will work. One of the minor issues is /dev/ttyr00 is not enumerated. There are several work arounds documented with the source code and on the wiki. The easiest solution for testing purposes is to make a symbolic link from /dev/ttyr00 to a port that is enumerated such as /dev/ttyS129. You can later alter the rxtx source or use properties to change the enumerated ports. -- Trent Jarvi tjarvi at qbang.org From d.tonhofer at m-plify.com Sun Apr 20 03:33:30 2008 From: d.tonhofer at m-plify.com (David Tonhofer (M-PLIFY S.A.)) Date: Sun, 20 Apr 2008 11:33:30 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: <480B0DEA.5010908@m-plify.com> Jeff Larsen wrote: > Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris It might be that the Java side of RXTX does not recognize that portname. Trying modifying src/RXTXCommDriver.java as described in this case: http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card From ajmas at sympatico.ca Sun Apr 20 16:37:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Apr 2008 18:37:59 -0400 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <480B0DEA.5010908@m-plify.com> References: <480B0DEA.5010908@m-plify.com> Message-ID: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > Jeff Larsen wrote: >> Next I tried RXTX on Linux, but I'm getting >> NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX >> on Solaris > It might be that the Java side of RXTX does not recognize that > portname. > Trying modifying src/RXTXCommDriver.java as described in this case: > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card I wonder whether it would be worth allowing custom port prefixes as a system parameter? For example: gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" Andre From Martin.Oberhuber at windriver.com Tue Apr 22 12:34:36 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 22 Apr 2008 20:34:36 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> References: <480B0DEA.5010908@m-plify.com> <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE6485848056CD6CE@ism-mail03.corp.ad.wrs.com> Sounds like a great idea... I'm wondering how the "variable part" after the Prefixes could be specified though? What about allowing Regular Expression character Classes in the existing System Property for specifying ports: System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyS[0-9],ttyS[ABC],ttyUSB[0-9a-z]"); The set of allowed patterns would of course need to Be restricted compared to REGEX, because it must be A syntax that supports iterating over it. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Montag, 21. April 2008 00:38 > To: rxtx at qbang.org and Users > Subject: Re: [Rxtx] Moxa serial over Ethernet driver > > > On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > > Jeff Larsen wrote: > >> Next I tried RXTX on Linux, but I'm getting > >> NoSuchPortException connecting to /dev/ttyr00. I have yet > to try RXTX > >> on Solaris > > It might be that the Java side of RXTX does not recognize that > > portname. > > Trying modifying src/RXTXCommDriver.java as described in this case: > > > > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_ > SST-4P.2FLP_multiport_card > > I wonder whether it would be worth allowing custom port > prefixes as a > system parameter? For > example: > > gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Loi.TRAN at weatherford.com Tue Apr 22 13:10:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Tue, 22 Apr 2008 14:10:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled Message-ID: Hi, I'm currently using the Java RXTX API to interface to a serial port. The serial port is connected to a bridge board that communicates with our communications system running at 1.875 Mbps which is linked to an embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no flow control). I send a command to the embedded board through the serial-bridge board which then is relayed to the embedded board. The command sent asks the embedded board to dump a binary image. Here's where I'm hitting some problems. I've successfully done this is an integrated serial port from the laptop. The binary file that comes back is consistent on every attempt. When I use the application I've written to do the same thing with a USB-to-serial adapter, the image I get back is not the same as the image I receive through the USB-to-serial adapter is not consistent at all. A final thing is that when I use a terminal program to dump the binary image with the USB-serial adapter, the image is correct. Every time! What is the terminal program doing that's not being done in my application? My application is quite simple. Has anyone observed this behavior before? If you have, I'd like to know how you've gotten around this problem. Thanks, LT =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From tjarvi at qbang.org Tue Apr 22 21:11:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 22 Apr 2008 21:11:10 -0600 (MDT) Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org From Loi.TRAN at weatherford.com Wed Apr 23 08:35:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Wed, 23 Apr 2008 09:35:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: Thanks for all the responses. I finally tried something that worked consistently. I updated my Prolific driver and repeated my tests. It worked. If you're using the Prolific type USB-serial adapters, do no use the Prolific version 2.0.2.1 driver on Windows. Update it to the latest 2.0.2.8 version. Again, thanks for all the responses. LT -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Tuesday, April 22, 2008 10:11 PM To: TRAN, Loi X. Cc: rxtx at qbang.org Subject: Re: [Rxtx] Prolific USB - RXTX data mangled On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From Martin.Oberhuber at windriver.com Wed Apr 23 18:54:26 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 02:54:26 +0200 Subject: [Rxtx] RXTX port locking on Linux status? Message-ID: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Dear RXTX community, I'm wondering what the status is with RXTX locking serial ports on Linux? My understanding is that the mechanism used in 2.1-7r2 (lockfiles) is not really state of the art, and has lots of problems (e.g. missing permissions). There was an idea to migrate towards a Kernel syscall based solution for port locking. What's the status here? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/9878db9f/attachment-0007.html From tjarvi at qbang.org Wed Apr 23 20:32:24 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Apr 2008 20:32:24 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > Dear RXTX community, > > I'm wondering what the status is with RXTX locking > serial ports on Linux? > > My understanding is that the mechanism used in > 2.1-7r2 (lockfiles) is not really state of the art, and > has lots of problems (e.g. missing permissions). > > There was an idea to migrate towards a Kernel > syscall based solution for port locking. > > What's the status here? > Hi Martin, I'm in favor of deprecating the current FHS locking mechanism in favor of an IOCTL when available. I think it will be available on all the platforms but do not know for sure. The status is unchanged. I've had very few free cycles for such things. Feel free to take a stab at it if you have some time. I believe the IOCTL is used in the Mac OS X code already. I don't see any real backwards compatability issues and the IOCTL should just work. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Apr 24 06:14:06 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 14:14:06 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Thanks Trent. Problem is only that I'm really not at all Familiar with the C part of RXTX. If there Were anything I could do in Java for this, It would be easier for me.... ... Are there any C experts here on the list Who'd like to look at ioctl port locking For linux? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Donnerstag, 24. April 2008 04:32 > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > I'm wondering what the status is with RXTX locking > > serial ports on Linux? > > > > My understanding is that the mechanism used in > > 2.1-7r2 (lockfiles) is not really state of the art, and > > has lots of problems (e.g. missing permissions). > > > > There was an idea to migrate towards a Kernel > > syscall based solution for port locking. > > > > What's the status here? > > > > Hi Martin, > > I'm in favor of deprecating the current FHS locking mechanism > in favor of > an IOCTL when available. I think it will be available on all the > platforms but do not know for sure. > > The status is unchanged. I've had very few free cycles for > such things. > Feel free to take a stab at it if you have some time. I > believe the IOCTL > is used in the Mac OS X code already. > > I don't see any real backwards compatability issues and the > IOCTL should > just work. > > -- > Trent Jarvi > tjarvi at qbang.org > From sspies at sloc.de Thu Apr 24 07:15:36 2008 From: sspies at sloc.de (Sebastian Spies) Date: Thu, 24 Apr 2008 15:15:36 +0200 (CEST) Subject: [Rxtx] rxtx on gumstix: Interrupted system call In-Reply-To: <47FB7B20.7080504@sloc.de> References: <47FB7B20.7080504@sloc.de> Message-ID: <55445.130.83.139.205.1209042936.squirrel@ssl.sloc.de> Dear list, while porting rxtx to the gumstix, I found out, that select used in readArray in SerialImp.c might not work as expected. Maybe, because of missing TIOCSERGETLSR-support? select is often interrupted, so i wrote the following quick'n'dirty hack to make it work on gumstix: diff -Nur rxtx-2.1-7r2/src/SerialImp.c rxtx-2.1-7r2/src/SerialImp.c --- rxtx-2.1-7r2/src/SerialImp.c 2006-01-29 23:19:04.000000000 +0100 +++ rxtx-2.1-7r2-patched/src/SerialImp.c 2008-04-24 14:30:17.000000000 +0200 @@ -3380,7 +3381,7 @@ JNIEXPORT jint JNICALL RXTXPort(readArray)( JNIEnv *env, jobject jobj, jbyteArray jbarray, jint offset, jint length ) { - int bytes; + int bytes = 0; jbyte *body; /* char msg[80]; */ int fd = get_java_var( env, jobj, "fd", "I" ); @@ -3397,9 +3398,18 @@ "readArray", "Invalid length" ); return -1; } - body = (*env)->GetByteArrayElements( env, jbarray, 0 ); - bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ - (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + while(1 > bytes) + { + body = (*env)->GetByteArrayElements( env, jbarray, 0 ); + bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ + (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + // quick'n'dirty - SSP + report (" trying again... \n"); + errno = 0; + } + if( bytes < 0 ) { report( "RXTXPort:readArray bytes < 0" ); LEAVE( "RXTXPort:readArray" ); > Hey, > > I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use > RXTXPort$SerialInputStream.read(), then I get the following Exception. I > did not yet figure out which system call is interrupted as strace > produces loads of output. > > Any help would be very appreciated. Thanks in advance. > Sebastian > > > [java] java.io.IOException: Interrupted system call in readArray > [java] at gnu.io.RXTXPort.readArray(Native Method) > [java] at > gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) > [java] at > java.io.FilterInputStream.read(FilterInputStream.java:189) > [java] at > java.io.BufferedInputStream.refill(BufferedInputStream.java:371) > [java] at > java.io.BufferedInputStream.read(BufferedInputStream.java:229) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) > [java] at > com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) > > -- > Sebastian Spies > > mail: sspies at sloc.de > > > > From fire_baptized at hotmail.com Thu Apr 24 18:27:48 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Thu, 24 Apr 2008 20:27:48 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hello I am having a problem with the serial device connecting (software wise) to the serial port. However I have a test program and it seems to work just fine in that environment - and it doesnt use GUI. The error I am getting is : PortNotFoundException Now the way I have it setup in the GUI environment is that once the user pushes a JButton the program connects using this class: protected void establishConnection() { try { portId = CommPortIdentifier.getPortIdentifier("COM3"); System.out.println("Establishing connction....."); messages[0] = "\nEstablishing connction.....\n"; } catch ( NoSuchPortException noport) { System.out.println("Port not found: "+ noport); messages[0] = "Port not found: "+ noport+"\n"; } try { serialPort = (SerialPort) portId.open("serial", 50); System.out.println("Port has been found."); messages[1] = "Port has been found.\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[1] = "" +usedport; } try { serialPort = (SerialPort) portId.open("serial", 50); messages[2] = "Connecting to COM3 on port 50....\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; } try { serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); System.out.println("Esablishing the transfer rate settings for COM3."); messages[3] = "Esablishing the transfer rate settings for COM3.\n"; } catch (UnsupportedCommOperationException nosupcom) { System.out.println(nosupcom); System.out.println("The tranfer rate could not be esblished on COM3."); messages[3] = "The tranfer rate could not be esblished on COM3.\n"; } System.out.println(serialPort.getFlowControlMode()); messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; //sendDataOut(buffer[3],buffer[4]); } I need all the data in this method (and all the string values in this method) to be printed out on a JTextArea. I wont do me any good if not all the text is printed on a JTextArea in another class. So I have the text printing the JTextArea correctly, but everytime the JButton is activated - it gives me that error message. I did add a disconnect button that is supposed to call the serialPort.close(). _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/273fd4ec/attachment-0006.html From tjarvi at qbang.org Thu Apr 24 21:54:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Apr 2008 21:54:10 -0600 (MDT) Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > Hello I am having a problem with the serial device connecting (software > wise) to the serial port. However I have a test program and it seems to > work just fine in that environment - and it doesnt use GUI. The error I > am getting is : PortNotFoundException Now the way I have it setup in the > GUI environment is that once the user pushes a JButton the program > connects using this class: > > protected void establishConnection() { > try { > portId = CommPortIdentifier.getPortIdentifier("COM3"); > System.out.println("Establishing connction....."); > messages[0] = "\nEstablishing connction.....\n"; > } > catch ( NoSuchPortException noport) { > System.out.println("Port not found: "+ noport); > messages[0] = "Port not found: "+ noport+"\n"; > } > try { > serialPort = (SerialPort) portId.open("serial", 50); > System.out.println("Port has been found."); > messages[1] = "Port has been found.\n"; > } > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[1] = "" +usedport; > } ================================================================= > try { > serialPort = (SerialPort) portId.open("serial", 50); > messages[2] = "Connecting to COM3 on port 50....\n"; > } ================================================================== > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > } > try { > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > System.out.println("Esablishing the transfer rate settings for COM3."); > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > } > catch (UnsupportedCommOperationException nosupcom) { > System.out.println(nosupcom); > System.out.println("The tranfer rate could not be esblished on COM3."); > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > } > System.out.println(serialPort.getFlowControlMode()); > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > //sendDataOut(buffer[3],buffer[4]); > } > > I need all the data in this method (and all the string values in this > method) to be printed out on a JTextArea. I wont do me any good if not > all the text is printed on a JTextArea in another class. So I have the > text printing the JTextArea correctly, but everytime the JButton is > activated - it gives me that error message. I did add a disconnect > button that is supposed to call the serialPort.close(). > The open code used twice is going to throw an exception. It may be that you catch the exception above this code and print a confusing message? A common mistake is people will accidently run two copies of their program. The first instance of the program will open the port and prevent enumeration (finding the port) in the second instance of the program. As an example, you may be running your text based application which is preventing the GUI from seeing the port. Enumeration is done by trying to open the port. If the port is open, Enumeration fails. -- Trent Jarvi tjarvi at qbang.org From fire_baptized at hotmail.com Thu Apr 24 22:32:05 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 00:32:05 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Wow - thanks dude what a dumb thing for me to not catch..... now here is the current problem - right now I am trying to output data again one is with the test program - and it seems that serialPort.setRTS(true); is throwing an exceptions there - now if I show this code please bare in mind that I am only testing - the code is kinda sloppy in my mind - but if I can figure out why calling this function is throwing an exception then maybe I can figure out why my GUI application is getting the same null pointer exceptions when try to send out the data stream. FYI Trent this email is not directed towards you - anyone can jump in on this public static void main(String args[]) { byte[] b = new byte[64]; int keyinput = 0 ; byte x = 0; byte y = 0; PortTesting1 testports = new PortTesting1(); try { joyskoro = Joystick.createInstance(); } catch (IOException ioexc) { System.out.println("There is an input/output problem: " + ioexc); } while (true) { joyskoro.poll(); b[0] = ((byte) -(10 * joyskoro.getY())); b[1] = ((byte) (10 * joyskoro.getX())); System.out.println("The 3rd byte is: " +b[0]); System.out.println("The 4rd byte is: " +b[1]); serialPort.setRTS(true); // HERE IS WHERE THE PROBLEM IS !!!!!!! ON THIS LINE but if I dont have it active in my program the Bluetooth device (that is System.out.println("Ready to send :-) !"); //connected to the serial port does not send out data!!!!! if (joyskoro.isButtonDown(joyskoro.BUTTON10)) { System.out.println("Connection terminated."); serialPort.close(); break; } if (joyskoro.isButtonDown(joyskoro.BUTTON2)) { boolean flag = true; //reading from key input from the keyboard System.out.println("Please input a command: "); while (flag) { try { keyinput = System.in.read(); } catch (IOException ioexc) {/*there is no need to put * anything here */ } if((char)keyinput=='w') { pushIt((byte)85); } if((char)keyinput=='s') { pushIt((byte)84); } if((char)keyinput=='a') { pushIt((byte)83); } if((char)keyinput=='d') { pushIt((byte)82); } if((char)keyinput=='q') { pushIt((byte)89); } if((char)keyinput=='\t') { //this stop reading input from the keyboard flag = false; } } and help anyways here is the block of code that throwing an exception for the test program: > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/5c8f7d68/attachment-0006.html From fire_baptized at hotmail.com Fri Apr 25 07:59:53 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 09:59:53 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Are there any examples of how to push out data? As in using input and output streams - if I can compare code maybe I can see where this is causing a problem. I have a byte array that I am pushing out data. I keep getting null pointer exceptions every where I turn. > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/22228ab6/attachment-0005.html From ajmas at sympatico.ca Sat Apr 26 07:37:09 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 26 Apr 2008 09:37:09 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hi, On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote: > > Are there any examples of how to push out data? As in using input > and output streams - if I can compare code maybe I can see where > this is causing a problem. I have a byte array that I am pushing > out data. I keep getting null pointer exceptions every where I turn. > There are some examples here that might be of help: http://rxtx.qbang.org/wiki/index.php/Examples Andre From fire_baptized at hotmail.com Sat Apr 26 20:13:54 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Sat, 26 Apr 2008 22:13:54 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: looked at those....yep didnt help - I need to push out data with GUI and not get a null pointer exception everytime I try. > CC: rxtx at qbang.org> From: ajmas at sympatico.ca> To: fire_baptized at hotmail.com> Subject: Re: [Rxtx] Serial Problems with Gui.....> Date: Sat, 26 Apr 2008 09:37:09 -0400> > Hi,> > > On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote:> >> > Are there any examples of how to push out data? As in using input > > and output streams - if I can compare code maybe I can see where > > this is causing a problem. I have a byte array that I am pushing > > out data. I keep getting null pointer exceptions every where I turn.> >> > There are some examples here that might be of help:> > http://rxtx.qbang.org/wiki/index.php/Examples> > Andre _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080426/09f95b41/attachment-0004.html From michael.erskine at ketech.com Mon Apr 28 02:47:22 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 28 Apr 2008 09:47:22 +0100 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D426EF3CBBC5@no-sv-03.ketech.local> Jesrael D. Summerhill wrote: > looked at those....yep didnt help - I need to push out data with GUI and > not get a null pointer exception everytime I try. So it seems pretty obvious that your code needs to check for nulls wherever one may occur and report what's happening. Alternatively, catch the npe and display the stack trace. Then you can fix your code so it doesn't try to work with something that ain't there. Regards, Michael Erskine. From scldad at sdc.com.au Mon Apr 28 03:58:34 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Mon, 28 Apr 2008 19:28:34 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Message-ID: <200804281928.34454.scldad@sdc.com.au> Has anybody done any design work on this? The first thing that springs to mind is that we still need to check for lock files because other apps tend to use that approach even if we go to ioctl. Cheers, Stephen Davies On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > Thanks Trent. > > Problem is only that I'm really not at all > Familiar with the C part of RXTX. If there > Were anything I could do in Java for this, > It would be easier for me.... > > ... Are there any C experts here on the list > Who'd like to look at ioctl port locking > For linux? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > -----Original Message----- > > From: Trent Jarvi [mailto:tjarvi at qbang.org] > > Sent: Donnerstag, 24. April 2008 04:32 > > To: Oberhuber, Martin > > Cc: rxtx at qbang.org > > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > > > I'm wondering what the status is with RXTX locking > > > serial ports on Linux? > > > > > > My understanding is that the mechanism used in > > > 2.1-7r2 (lockfiles) is not really state of the art, and > > > has lots of problems (e.g. missing permissions). > > > > > > There was an idea to migrate towards a Kernel > > > syscall based solution for port locking. > > > > > > What's the status here? > > > > Hi Martin, > > > > I'm in favor of deprecating the current FHS locking mechanism > > in favor of > > an IOCTL when available. I think it will be available on all the > > platforms but do not know for sure. > > > > The status is unchanged. I've had very few free cycles for > > such things. > > Feel free to take a stab at it if you have some time. I > > believe the IOCTL > > is used in the Mac OS X code already. > > > > I don't see any real backwards compatability issues and the > > IOCTL should > > just work. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Mon Apr 28 04:21:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 28 Apr 2008 04:21:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804281928.34454.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: I don't think there would need to be any architectural changes. A couple ifdefs and minor changes in the current code should be enough. Proposal: FHS/UUCP locks: continue to respect them, try to create them but do not error if the IOCTL is supported. (But does the IOCTL being defined mean it will work?) Enumeration: Do not assert the IOCTL while opening. Serial.open: assert the IOCTL after open. Continue to use locks as described above after asserting the IOCTL. If the IOCTL is defined but not working, handle it here. Failure cases include the IOCTL is not supported and the port is already locked. On Mon, 28 Apr 2008, Stephen Davies wrote: > Has anybody done any design work on this? > The first thing that springs to mind is that we still need to check for lock > files because other apps tend to use that approach even if we go to ioctl. > > Cheers, > Stephen Davies > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: >> Thanks Trent. >> >> Problem is only that I'm really not at all >> Familiar with the C part of RXTX. If there >> Were anything I could do in Java for this, >> It would be easier for me.... >> >> ... Are there any C experts here on the list >> Who'd like to look at ioctl port locking >> For linux? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >>> -----Original Message----- >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] >>> Sent: Donnerstag, 24. April 2008 04:32 >>> To: Oberhuber, Martin >>> Cc: rxtx at qbang.org >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? >>> >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: >>>> Dear RXTX community, >>>> >>>> I'm wondering what the status is with RXTX locking >>>> serial ports on Linux? >>>> >>>> My understanding is that the mechanism used in >>>> 2.1-7r2 (lockfiles) is not really state of the art, and >>>> has lots of problems (e.g. missing permissions). >>>> >>>> There was an idea to migrate towards a Kernel >>>> syscall based solution for port locking. >>>> >>>> What's the status here? >>> >>> Hi Martin, >>> >>> I'm in favor of deprecating the current FHS locking mechanism >>> in favor of >>> an IOCTL when available. I think it will be available on all the >>> platforms but do not know for sure. >>> >>> The status is unchanged. I've had very few free cycles for >>> such things. >>> Feel free to take a stab at it if you have some time. I >>> believe the IOCTL >>> is used in the Mac OS X code already. >>> >>> I don't see any real backwards compatability issues and the >>> IOCTL should >>> just work. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Tue Apr 29 12:04:04 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Apr 2008 20:04:04 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Hi all, The biggest problem that I have seen with lockfiles on Linux At least is, that it seems there is no standard with respect To the folder in which they should be created. Also, many Distributions seem to set up file system permissions in such A way that writing to the lockfile folder is not allowed for The normal user -- that's why we stopped using lockfiles In our commercial product. If we are to still respect lockfiles, we first need to Understand where we are expected to look for them. Does Anybody have any insight what variants of lockfile folder Schema exist out there in the wild? Some apps like minicom Seem to even allow users to manually specify a lockfile Folder of their choice. Because of the difficulty finding the right lockfile folder, And because of the inherent risk of thinking that something Might be locked while it actually isn't, I'd suggest that RXTX should have a "soft-off" feature that allows disabling ALL Lockfile checks at runtime without recompiling the native Sharedlibs. Trent - I like your strategy outline, but I think that it Needs to be configurable by the client such that users and/or Customer Support can disable lockfiles / disable ioctl in Case they detect that they are runing on an OS / Kernal that Does not support one or the other. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Montag, 28. April 2008 12:22 > To: Stephen Davies > Cc: rxtx at qbang.org; Oberhuber, Martin; Trent Jarvi > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > I don't think there would need to be any architectural > changes. A couple > ifdefs and minor changes in the current code should be enough. > > Proposal: > > FHS/UUCP locks: > continue to respect them, try to create them but do not error if > the IOCTL is supported. (But does the IOCTL being defined mean > it will work?) > Enumeration: > Do not assert the IOCTL while opening. > Serial.open: > assert the IOCTL after open. Continue to use locks as described > above after asserting the IOCTL. If the IOCTL is defined but > not working, handle it here. Failure cases include the IOCTL > is not supported and the port is already locked. > > On Mon, 28 Apr 2008, Stephen Davies wrote: > > > Has anybody done any design work on this? > > The first thing that springs to mind is that we still need > to check for lock > > files because other apps tend to use that approach even if > we go to ioctl. > > > > Cheers, > > Stephen Davies > > > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > >> Thanks Trent. > >> > >> Problem is only that I'm really not at all > >> Familiar with the C part of RXTX. If there > >> Were anything I could do in Java for this, > >> It would be easier for me.... > >> > >> ... Are there any C experts here on the list > >> Who'd like to look at ioctl port locking > >> For linux? > >> > >> Thanks, > >> -- > >> Martin Oberhuber, Senior Member of Technical Staff, Wind River > >> Target Management Project Lead, DSDP PMC Member > >> http://www.eclipse.org/dsdp/tm > >> > >>> -----Original Message----- > >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] > >>> Sent: Donnerstag, 24. April 2008 04:32 > >>> To: Oberhuber, Martin > >>> Cc: rxtx at qbang.org > >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? > >>> > >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > >>>> Dear RXTX community, > >>>> > >>>> I'm wondering what the status is with RXTX locking > >>>> serial ports on Linux? > >>>> > >>>> My understanding is that the mechanism used in > >>>> 2.1-7r2 (lockfiles) is not really state of the art, and > >>>> has lots of problems (e.g. missing permissions). > >>>> > >>>> There was an idea to migrate towards a Kernel > >>>> syscall based solution for port locking. > >>>> > >>>> What's the status here? > >>> > >>> Hi Martin, > >>> > >>> I'm in favor of deprecating the current FHS locking mechanism > >>> in favor of > >>> an IOCTL when available. I think it will be available on all the > >>> platforms but do not know for sure. > >>> > >>> The status is unchanged. I've had very few free cycles for > >>> such things. > >>> Feel free to take a stab at it if you have some time. I > >>> believe the IOCTL > >>> is used in the Mac OS X code already. > >>> > >>> I don't see any real backwards compatability issues and the > >>> IOCTL should > >>> just work. > >>> > >>> -- > >>> Trent Jarvi > >>> tjarvi at qbang.org > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > From Steffen.DETTMER at ingenico.com Tue Apr 29 13:34:44 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 29 Apr 2008 21:34:44 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Message-ID: <20080429193444.GU2928@elberon.bln.de.ingenico.com> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > The biggest problem that I have seen with lockfiles on Linux > At least is, that it seems there is no standard with respect > To the folder in which they should be created. Also, many > Distributions seem to set up file system permissions in such > A way that writing to the lockfile folder is not allowed for > The normal user -- that's why we stopped using lockfiles > In our commercial product. It seems it depends on the expectations. I consider it as a feature that by default a linux user cannot access serial ports. Maybe root connected a modem (can produce phone bills) or even some serial card reader, maybe with the web servers key pair. I would expect that by default a user cannot open the serial port because of insufficient permissions on the device file. I would expect this on other unices as well (but I don't know it). For windows I think it should be similar but not impacting so much in practice, because often windows users work with big permissions on a somewhat high priviledge level or even Administrator. > If we are to still respect lockfiles, we first need to > Understand where we are expected to look for them. Does > Anybody have any insight what variants of lockfile folder > Schema exist out there in the wild? Some apps like minicom > Seem to even allow users to manually specify a lockfile > Folder of their choice. At least my (ancient) minicom does not allow the user to change this option, it is displayed but read-only, but root is allowed to change it. > Because of the difficulty finding the right lockfile folder, > And because of the inherent risk of thinking that something > Might be locked while it actually isn't, I'd suggest that > RXTX should have a "soft-off" feature that allows disabling > ALL Lockfile checks at runtime without recompiling the native > Sharedlibs. sounds very reasonable, yes... and as admin I would not wish that users could skip such locking because they do things wrong by default ;) (in the end I guess that is related to the dilemma, that hotplug/user-owned-periphery and multi-user systems simply conflict) > Trent - I like your strategy outline, but I think that it > Needs to be configurable by the client such that users and/or > Customer Support can disable lockfiles / disable ioctl in > Case they detect that they are runing on an OS / Kernal that > Does not support one or the other. Yes, this would be good I guess... Applications could offer configuration options to control that, maybe similarily as minicom. BTW, man minicom tells: *B - Lock file location On most systems This should be /usr/spool/uucp. Linux systems use /var/lock. If this directory does not exist, minicom will not attempt to use lockfiles. The statement `Linux systems use /var/lock' is interesting, does anyone know the source of this convention? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Tue Apr 29 16:11:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Apr 2008 16:11:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? These details are outlined in the Filesystem Hierarchy Standard (FHS). http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLOCKLOCKFILES -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Tue Apr 29 18:58:09 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Wed, 30 Apr 2008 10:28:09 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: <200804301028.09307.scldad@sdc.com.au> I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is the same. Any ideas as to how to handle this? Stephen On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: > * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > > The biggest problem that I have seen with lockfiles on Linux > > At least is, that it seems there is no standard with respect > > To the folder in which they should be created. Also, many > > Distributions seem to set up file system permissions in such > > A way that writing to the lockfile folder is not allowed for > > The normal user -- that's why we stopped using lockfiles > > In our commercial product. > > It seems it depends on the expectations. I consider it as a > feature that by default a linux user cannot access serial ports. > Maybe root connected a modem (can produce phone bills) or even > some serial card reader, maybe with the web servers key pair. > > I would expect that by default a user cannot open the serial port > because of insufficient permissions on the device file. I would > expect this on other unices as well (but I don't know it). > > For windows I think it should be similar but not impacting so > much in practice, because often windows users work with big > permissions on a somewhat high priviledge level or even > Administrator. > > > If we are to still respect lockfiles, we first need to > > Understand where we are expected to look for them. Does > > Anybody have any insight what variants of lockfile folder > > Schema exist out there in the wild? Some apps like minicom > > Seem to even allow users to manually specify a lockfile > > Folder of their choice. > > At least my (ancient) minicom does not allow the user to change > this option, it is displayed but read-only, but root is allowed > to change it. > > > Because of the difficulty finding the right lockfile folder, > > And because of the inherent risk of thinking that something > > Might be locked while it actually isn't, I'd suggest that > > RXTX should have a "soft-off" feature that allows disabling > > ALL Lockfile checks at runtime without recompiling the native > > Sharedlibs. > > sounds very reasonable, yes... > and as admin I would not wish that users could skip such > locking because they do things wrong by default ;) > > (in the end I guess that is related to the dilemma, that > hotplug/user-owned-periphery and multi-user systems simply > conflict) > > > Trent - I like your strategy outline, but I think that it > > Needs to be configurable by the client such that users and/or > > Customer Support can disable lockfiles / disable ioctl in > > Case they detect that they are runing on an OS / Kernal that > > Does not support one or the other. > > Yes, this would be good I guess... Applications could offer > configuration options to control that, maybe similarily as > minicom. > > BTW, man minicom tells: > > *B - Lock file location > On most systems This should be /usr/spool/uucp. > Linux systems use /var/lock. If this directory > does not exist, minicom will not attempt to use > lockfiles. > > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure > and expedient electronic transaction acceptance. Ingenico products leverage > proven technology, established standards and unparalleled ergonomics to > provide optimal reliability, versatility and usability. This comprehensive > range of products is complemented by a global array of services and > partnerships, enabling businesses in a number of vertical sectors to accept > transactions anywhere their business takes them. www.ingenico.com This > message may contain confidential and/or privileged information. If you are > not the addressee or authorized to receive this for the addressee, you must > not use, copy, disclose or take any action based on this message or any > information herein. If you have received this message in error, please > advise the sender immediately by reply e-mail and delete this message. > Thank you for your cooperation. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0030.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0028.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0015.html From pboulton at pulsetracer.com Fri Apr 18 14:30:13 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Fri, 18 Apr 2008 13:30:13 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site Message-ID: <480904D5.1060307@pulsetracer.com> Hello, gentle serial porters. I have downloaded the zipped up binaries for use on Windows without Sun's CommAPI, but don't seem able to extract anything from the download. Go to main page, http://www.rxtx.org/ Click on Downloads I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) And I save it to disk. If I try and extract the files with WinZip, Winzip thinks the archive is corrupt. If I try using Windows Explorer, I am able to extract it into a single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than the original .zip. Any help would be much appreciated. Sincerely, Philip Boulton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080418/97d89793/attachment-0013.html From tjarvi at qbang.org Fri Apr 18 19:07:00 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 18 Apr 2008 19:07:00 -0600 (MDT) Subject: [Rxtx] Difficulty opening zip file at rxtx site In-Reply-To: <480904D5.1060307@pulsetracer.com> References: <480904D5.1060307@pulsetracer.com> Message-ID: On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org From pboulton at pulsetracer.com Sat Apr 19 12:46:26 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Sat, 19 Apr 2008 11:46:26 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site References: <480904D5.1060307@pulsetracer.com> Message-ID: <53DB7576450695419E09299104043761A78533@ZTGSERVER.ztg.local> I have been able to get my hands on the binaries, by going to the ftp directory /pub/rxtx at ftp.qbang.org,, and ftping the file rxtx-2.1-7-bins-r2.zip . This opens happily with Winzip, and extracts as the set of files that you describe below. I only experience the ill-formed archive problem by clicking the link on the rxtx.org Downloads page (http://rxtx.qbang.org/pub/rxtx/ rxtx-2.1-7-bins-r2.zip ). Not sure what to make of that. Philip Boulton ________________________________ From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Fri 4/18/2008 6:07 PM To: Philip Boulton Cc: rxtx at qbang.org Subject: Re: [Rxtx] Difficulty opening zip file at rxtx site On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080419/147923bb/attachment-0012.html From jlar310 at gmail.com Sat Apr 19 19:11:55 2008 From: jlar310 at gmail.com (Jeff Larsen) Date: Sat, 19 Apr 2008 20:11:55 -0500 Subject: [Rxtx] Moxa serial over Ethernet driver Message-ID: Hi all, I've been using javax.comm for years to communicate with a legacy radio data system. We want to migrate the java side of the system to a VMware Server virtual machine. We've had great success using Moxa DE-303 and 5610 serial over Ethernet appliances and virtual machines for running hylafax. The OS (Linux in this case) uses a kernel driver to communicate with the Moxa via a virtual serial port such as /dev/ttyr00. I want to do the same thing with javax.comm or gnu.io to connect to a virtual serial port. However I'm hitting road blocks everywhere. javax.comm for Linux sees the virtual port, but there are transmission errors. Tried Solaris too, but the Solaris Moxa drivers don't play nice with javax.comm because the driver uses /dev/pts/n instead of /dev/term/x. Next I tried RXTX on Linux, but I'm getting NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX on Solaris. Has anyone used RXTX with serial over Ethernet devices? Any hints on how to make it work? I know that I'm not completely off track because javax.comm does work with Moxa on a Windows platform, but that's just not an option for production deployment. -- Jeff From tjarvi at qbang.org Sat Apr 19 21:08:41 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 19 Apr 2008 21:08:41 -0600 (MDT) Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: yOn Sat, 19 Apr 2008, Jeff Larsen wrote: > Hi all, > > I've been using javax.comm for years to communicate with a legacy > radio data system. We want to migrate the java side of the system to a > VMware Server virtual machine. We've had great success using Moxa > DE-303 and 5610 serial over Ethernet appliances and virtual machines > for running hylafax. The OS (Linux in this case) uses a kernel driver > to communicate with the Moxa via a virtual serial port such as > /dev/ttyr00. > > I want to do the same thing with javax.comm or gnu.io to connect to a > virtual serial port. However I'm hitting road blocks everywhere. > javax.comm for Linux sees the virtual port, but there are transmission > errors. Tried Solaris too, but the Solaris Moxa drivers don't play > nice with javax.comm because the driver uses /dev/pts/n instead of > /dev/term/x. Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris. > > Has anyone used RXTX with serial over Ethernet devices? Any hints on > how to make it work? > > I know that I'm not completely off track because javax.comm does work > with Moxa on a Windows platform, but that's just not an option for > production deployment. > > Moxa should work under linux. There may be minor issues depending upon how complete the kernel driver is but I think it will work. One of the minor issues is /dev/ttyr00 is not enumerated. There are several work arounds documented with the source code and on the wiki. The easiest solution for testing purposes is to make a symbolic link from /dev/ttyr00 to a port that is enumerated such as /dev/ttyS129. You can later alter the rxtx source or use properties to change the enumerated ports. -- Trent Jarvi tjarvi at qbang.org From d.tonhofer at m-plify.com Sun Apr 20 03:33:30 2008 From: d.tonhofer at m-plify.com (David Tonhofer (M-PLIFY S.A.)) Date: Sun, 20 Apr 2008 11:33:30 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: <480B0DEA.5010908@m-plify.com> Jeff Larsen wrote: > Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris It might be that the Java side of RXTX does not recognize that portname. Trying modifying src/RXTXCommDriver.java as described in this case: http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card From ajmas at sympatico.ca Sun Apr 20 16:37:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Apr 2008 18:37:59 -0400 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <480B0DEA.5010908@m-plify.com> References: <480B0DEA.5010908@m-plify.com> Message-ID: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > Jeff Larsen wrote: >> Next I tried RXTX on Linux, but I'm getting >> NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX >> on Solaris > It might be that the Java side of RXTX does not recognize that > portname. > Trying modifying src/RXTXCommDriver.java as described in this case: > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card I wonder whether it would be worth allowing custom port prefixes as a system parameter? For example: gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" Andre From Martin.Oberhuber at windriver.com Tue Apr 22 12:34:36 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 22 Apr 2008 20:34:36 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> References: <480B0DEA.5010908@m-plify.com> <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE6485848056CD6CE@ism-mail03.corp.ad.wrs.com> Sounds like a great idea... I'm wondering how the "variable part" after the Prefixes could be specified though? What about allowing Regular Expression character Classes in the existing System Property for specifying ports: System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyS[0-9],ttyS[ABC],ttyUSB[0-9a-z]"); The set of allowed patterns would of course need to Be restricted compared to REGEX, because it must be A syntax that supports iterating over it. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Montag, 21. April 2008 00:38 > To: rxtx at qbang.org and Users > Subject: Re: [Rxtx] Moxa serial over Ethernet driver > > > On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > > Jeff Larsen wrote: > >> Next I tried RXTX on Linux, but I'm getting > >> NoSuchPortException connecting to /dev/ttyr00. I have yet > to try RXTX > >> on Solaris > > It might be that the Java side of RXTX does not recognize that > > portname. > > Trying modifying src/RXTXCommDriver.java as described in this case: > > > > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_ > SST-4P.2FLP_multiport_card > > I wonder whether it would be worth allowing custom port > prefixes as a > system parameter? For > example: > > gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Loi.TRAN at weatherford.com Tue Apr 22 13:10:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Tue, 22 Apr 2008 14:10:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled Message-ID: Hi, I'm currently using the Java RXTX API to interface to a serial port. The serial port is connected to a bridge board that communicates with our communications system running at 1.875 Mbps which is linked to an embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no flow control). I send a command to the embedded board through the serial-bridge board which then is relayed to the embedded board. The command sent asks the embedded board to dump a binary image. Here's where I'm hitting some problems. I've successfully done this is an integrated serial port from the laptop. The binary file that comes back is consistent on every attempt. When I use the application I've written to do the same thing with a USB-to-serial adapter, the image I get back is not the same as the image I receive through the USB-to-serial adapter is not consistent at all. A final thing is that when I use a terminal program to dump the binary image with the USB-serial adapter, the image is correct. Every time! What is the terminal program doing that's not being done in my application? My application is quite simple. Has anyone observed this behavior before? If you have, I'd like to know how you've gotten around this problem. Thanks, LT =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From tjarvi at qbang.org Tue Apr 22 21:11:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 22 Apr 2008 21:11:10 -0600 (MDT) Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org From Loi.TRAN at weatherford.com Wed Apr 23 08:35:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Wed, 23 Apr 2008 09:35:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: Thanks for all the responses. I finally tried something that worked consistently. I updated my Prolific driver and repeated my tests. It worked. If you're using the Prolific type USB-serial adapters, do no use the Prolific version 2.0.2.1 driver on Windows. Update it to the latest 2.0.2.8 version. Again, thanks for all the responses. LT -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Tuesday, April 22, 2008 10:11 PM To: TRAN, Loi X. Cc: rxtx at qbang.org Subject: Re: [Rxtx] Prolific USB - RXTX data mangled On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From Martin.Oberhuber at windriver.com Wed Apr 23 18:54:26 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 02:54:26 +0200 Subject: [Rxtx] RXTX port locking on Linux status? Message-ID: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Dear RXTX community, I'm wondering what the status is with RXTX locking serial ports on Linux? My understanding is that the mechanism used in 2.1-7r2 (lockfiles) is not really state of the art, and has lots of problems (e.g. missing permissions). There was an idea to migrate towards a Kernel syscall based solution for port locking. What's the status here? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/9878db9f/attachment-0008.html From tjarvi at qbang.org Wed Apr 23 20:32:24 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Apr 2008 20:32:24 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > Dear RXTX community, > > I'm wondering what the status is with RXTX locking > serial ports on Linux? > > My understanding is that the mechanism used in > 2.1-7r2 (lockfiles) is not really state of the art, and > has lots of problems (e.g. missing permissions). > > There was an idea to migrate towards a Kernel > syscall based solution for port locking. > > What's the status here? > Hi Martin, I'm in favor of deprecating the current FHS locking mechanism in favor of an IOCTL when available. I think it will be available on all the platforms but do not know for sure. The status is unchanged. I've had very few free cycles for such things. Feel free to take a stab at it if you have some time. I believe the IOCTL is used in the Mac OS X code already. I don't see any real backwards compatability issues and the IOCTL should just work. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Apr 24 06:14:06 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 14:14:06 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Thanks Trent. Problem is only that I'm really not at all Familiar with the C part of RXTX. If there Were anything I could do in Java for this, It would be easier for me.... ... Are there any C experts here on the list Who'd like to look at ioctl port locking For linux? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Donnerstag, 24. April 2008 04:32 > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > I'm wondering what the status is with RXTX locking > > serial ports on Linux? > > > > My understanding is that the mechanism used in > > 2.1-7r2 (lockfiles) is not really state of the art, and > > has lots of problems (e.g. missing permissions). > > > > There was an idea to migrate towards a Kernel > > syscall based solution for port locking. > > > > What's the status here? > > > > Hi Martin, > > I'm in favor of deprecating the current FHS locking mechanism > in favor of > an IOCTL when available. I think it will be available on all the > platforms but do not know for sure. > > The status is unchanged. I've had very few free cycles for > such things. > Feel free to take a stab at it if you have some time. I > believe the IOCTL > is used in the Mac OS X code already. > > I don't see any real backwards compatability issues and the > IOCTL should > just work. > > -- > Trent Jarvi > tjarvi at qbang.org > From sspies at sloc.de Thu Apr 24 07:15:36 2008 From: sspies at sloc.de (Sebastian Spies) Date: Thu, 24 Apr 2008 15:15:36 +0200 (CEST) Subject: [Rxtx] rxtx on gumstix: Interrupted system call In-Reply-To: <47FB7B20.7080504@sloc.de> References: <47FB7B20.7080504@sloc.de> Message-ID: <55445.130.83.139.205.1209042936.squirrel@ssl.sloc.de> Dear list, while porting rxtx to the gumstix, I found out, that select used in readArray in SerialImp.c might not work as expected. Maybe, because of missing TIOCSERGETLSR-support? select is often interrupted, so i wrote the following quick'n'dirty hack to make it work on gumstix: diff -Nur rxtx-2.1-7r2/src/SerialImp.c rxtx-2.1-7r2/src/SerialImp.c --- rxtx-2.1-7r2/src/SerialImp.c 2006-01-29 23:19:04.000000000 +0100 +++ rxtx-2.1-7r2-patched/src/SerialImp.c 2008-04-24 14:30:17.000000000 +0200 @@ -3380,7 +3381,7 @@ JNIEXPORT jint JNICALL RXTXPort(readArray)( JNIEnv *env, jobject jobj, jbyteArray jbarray, jint offset, jint length ) { - int bytes; + int bytes = 0; jbyte *body; /* char msg[80]; */ int fd = get_java_var( env, jobj, "fd", "I" ); @@ -3397,9 +3398,18 @@ "readArray", "Invalid length" ); return -1; } - body = (*env)->GetByteArrayElements( env, jbarray, 0 ); - bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ - (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + while(1 > bytes) + { + body = (*env)->GetByteArrayElements( env, jbarray, 0 ); + bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ + (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + // quick'n'dirty - SSP + report (" trying again... \n"); + errno = 0; + } + if( bytes < 0 ) { report( "RXTXPort:readArray bytes < 0" ); LEAVE( "RXTXPort:readArray" ); > Hey, > > I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use > RXTXPort$SerialInputStream.read(), then I get the following Exception. I > did not yet figure out which system call is interrupted as strace > produces loads of output. > > Any help would be very appreciated. Thanks in advance. > Sebastian > > > [java] java.io.IOException: Interrupted system call in readArray > [java] at gnu.io.RXTXPort.readArray(Native Method) > [java] at > gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) > [java] at > java.io.FilterInputStream.read(FilterInputStream.java:189) > [java] at > java.io.BufferedInputStream.refill(BufferedInputStream.java:371) > [java] at > java.io.BufferedInputStream.read(BufferedInputStream.java:229) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) > [java] at > com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) > > -- > Sebastian Spies > > mail: sspies at sloc.de > > > > From fire_baptized at hotmail.com Thu Apr 24 18:27:48 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Thu, 24 Apr 2008 20:27:48 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hello I am having a problem with the serial device connecting (software wise) to the serial port. However I have a test program and it seems to work just fine in that environment - and it doesnt use GUI. The error I am getting is : PortNotFoundException Now the way I have it setup in the GUI environment is that once the user pushes a JButton the program connects using this class: protected void establishConnection() { try { portId = CommPortIdentifier.getPortIdentifier("COM3"); System.out.println("Establishing connction....."); messages[0] = "\nEstablishing connction.....\n"; } catch ( NoSuchPortException noport) { System.out.println("Port not found: "+ noport); messages[0] = "Port not found: "+ noport+"\n"; } try { serialPort = (SerialPort) portId.open("serial", 50); System.out.println("Port has been found."); messages[1] = "Port has been found.\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[1] = "" +usedport; } try { serialPort = (SerialPort) portId.open("serial", 50); messages[2] = "Connecting to COM3 on port 50....\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; } try { serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); System.out.println("Esablishing the transfer rate settings for COM3."); messages[3] = "Esablishing the transfer rate settings for COM3.\n"; } catch (UnsupportedCommOperationException nosupcom) { System.out.println(nosupcom); System.out.println("The tranfer rate could not be esblished on COM3."); messages[3] = "The tranfer rate could not be esblished on COM3.\n"; } System.out.println(serialPort.getFlowControlMode()); messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; //sendDataOut(buffer[3],buffer[4]); } I need all the data in this method (and all the string values in this method) to be printed out on a JTextArea. I wont do me any good if not all the text is printed on a JTextArea in another class. So I have the text printing the JTextArea correctly, but everytime the JButton is activated - it gives me that error message. I did add a disconnect button that is supposed to call the serialPort.close(). _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/273fd4ec/attachment-0007.html From tjarvi at qbang.org Thu Apr 24 21:54:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Apr 2008 21:54:10 -0600 (MDT) Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > Hello I am having a problem with the serial device connecting (software > wise) to the serial port. However I have a test program and it seems to > work just fine in that environment - and it doesnt use GUI. The error I > am getting is : PortNotFoundException Now the way I have it setup in the > GUI environment is that once the user pushes a JButton the program > connects using this class: > > protected void establishConnection() { > try { > portId = CommPortIdentifier.getPortIdentifier("COM3"); > System.out.println("Establishing connction....."); > messages[0] = "\nEstablishing connction.....\n"; > } > catch ( NoSuchPortException noport) { > System.out.println("Port not found: "+ noport); > messages[0] = "Port not found: "+ noport+"\n"; > } > try { > serialPort = (SerialPort) portId.open("serial", 50); > System.out.println("Port has been found."); > messages[1] = "Port has been found.\n"; > } > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[1] = "" +usedport; > } ================================================================= > try { > serialPort = (SerialPort) portId.open("serial", 50); > messages[2] = "Connecting to COM3 on port 50....\n"; > } ================================================================== > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > } > try { > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > System.out.println("Esablishing the transfer rate settings for COM3."); > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > } > catch (UnsupportedCommOperationException nosupcom) { > System.out.println(nosupcom); > System.out.println("The tranfer rate could not be esblished on COM3."); > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > } > System.out.println(serialPort.getFlowControlMode()); > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > //sendDataOut(buffer[3],buffer[4]); > } > > I need all the data in this method (and all the string values in this > method) to be printed out on a JTextArea. I wont do me any good if not > all the text is printed on a JTextArea in another class. So I have the > text printing the JTextArea correctly, but everytime the JButton is > activated - it gives me that error message. I did add a disconnect > button that is supposed to call the serialPort.close(). > The open code used twice is going to throw an exception. It may be that you catch the exception above this code and print a confusing message? A common mistake is people will accidently run two copies of their program. The first instance of the program will open the port and prevent enumeration (finding the port) in the second instance of the program. As an example, you may be running your text based application which is preventing the GUI from seeing the port. Enumeration is done by trying to open the port. If the port is open, Enumeration fails. -- Trent Jarvi tjarvi at qbang.org From fire_baptized at hotmail.com Thu Apr 24 22:32:05 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 00:32:05 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Wow - thanks dude what a dumb thing for me to not catch..... now here is the current problem - right now I am trying to output data again one is with the test program - and it seems that serialPort.setRTS(true); is throwing an exceptions there - now if I show this code please bare in mind that I am only testing - the code is kinda sloppy in my mind - but if I can figure out why calling this function is throwing an exception then maybe I can figure out why my GUI application is getting the same null pointer exceptions when try to send out the data stream. FYI Trent this email is not directed towards you - anyone can jump in on this public static void main(String args[]) { byte[] b = new byte[64]; int keyinput = 0 ; byte x = 0; byte y = 0; PortTesting1 testports = new PortTesting1(); try { joyskoro = Joystick.createInstance(); } catch (IOException ioexc) { System.out.println("There is an input/output problem: " + ioexc); } while (true) { joyskoro.poll(); b[0] = ((byte) -(10 * joyskoro.getY())); b[1] = ((byte) (10 * joyskoro.getX())); System.out.println("The 3rd byte is: " +b[0]); System.out.println("The 4rd byte is: " +b[1]); serialPort.setRTS(true); // HERE IS WHERE THE PROBLEM IS !!!!!!! ON THIS LINE but if I dont have it active in my program the Bluetooth device (that is System.out.println("Ready to send :-) !"); //connected to the serial port does not send out data!!!!! if (joyskoro.isButtonDown(joyskoro.BUTTON10)) { System.out.println("Connection terminated."); serialPort.close(); break; } if (joyskoro.isButtonDown(joyskoro.BUTTON2)) { boolean flag = true; //reading from key input from the keyboard System.out.println("Please input a command: "); while (flag) { try { keyinput = System.in.read(); } catch (IOException ioexc) {/*there is no need to put * anything here */ } if((char)keyinput=='w') { pushIt((byte)85); } if((char)keyinput=='s') { pushIt((byte)84); } if((char)keyinput=='a') { pushIt((byte)83); } if((char)keyinput=='d') { pushIt((byte)82); } if((char)keyinput=='q') { pushIt((byte)89); } if((char)keyinput=='\t') { //this stop reading input from the keyboard flag = false; } } and help anyways here is the block of code that throwing an exception for the test program: > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/5c8f7d68/attachment-0007.html From fire_baptized at hotmail.com Fri Apr 25 07:59:53 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 09:59:53 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Are there any examples of how to push out data? As in using input and output streams - if I can compare code maybe I can see where this is causing a problem. I have a byte array that I am pushing out data. I keep getting null pointer exceptions every where I turn. > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/22228ab6/attachment-0006.html From ajmas at sympatico.ca Sat Apr 26 07:37:09 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 26 Apr 2008 09:37:09 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hi, On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote: > > Are there any examples of how to push out data? As in using input > and output streams - if I can compare code maybe I can see where > this is causing a problem. I have a byte array that I am pushing > out data. I keep getting null pointer exceptions every where I turn. > There are some examples here that might be of help: http://rxtx.qbang.org/wiki/index.php/Examples Andre From fire_baptized at hotmail.com Sat Apr 26 20:13:54 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Sat, 26 Apr 2008 22:13:54 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: looked at those....yep didnt help - I need to push out data with GUI and not get a null pointer exception everytime I try. > CC: rxtx at qbang.org> From: ajmas at sympatico.ca> To: fire_baptized at hotmail.com> Subject: Re: [Rxtx] Serial Problems with Gui.....> Date: Sat, 26 Apr 2008 09:37:09 -0400> > Hi,> > > On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote:> >> > Are there any examples of how to push out data? As in using input > > and output streams - if I can compare code maybe I can see where > > this is causing a problem. I have a byte array that I am pushing > > out data. I keep getting null pointer exceptions every where I turn.> >> > There are some examples here that might be of help:> > http://rxtx.qbang.org/wiki/index.php/Examples> > Andre _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080426/09f95b41/attachment-0005.html From michael.erskine at ketech.com Mon Apr 28 02:47:22 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 28 Apr 2008 09:47:22 +0100 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D426EF3CBBC5@no-sv-03.ketech.local> Jesrael D. Summerhill wrote: > looked at those....yep didnt help - I need to push out data with GUI and > not get a null pointer exception everytime I try. So it seems pretty obvious that your code needs to check for nulls wherever one may occur and report what's happening. Alternatively, catch the npe and display the stack trace. Then you can fix your code so it doesn't try to work with something that ain't there. Regards, Michael Erskine. From scldad at sdc.com.au Mon Apr 28 03:58:34 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Mon, 28 Apr 2008 19:28:34 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Message-ID: <200804281928.34454.scldad@sdc.com.au> Has anybody done any design work on this? The first thing that springs to mind is that we still need to check for lock files because other apps tend to use that approach even if we go to ioctl. Cheers, Stephen Davies On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > Thanks Trent. > > Problem is only that I'm really not at all > Familiar with the C part of RXTX. If there > Were anything I could do in Java for this, > It would be easier for me.... > > ... Are there any C experts here on the list > Who'd like to look at ioctl port locking > For linux? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > -----Original Message----- > > From: Trent Jarvi [mailto:tjarvi at qbang.org] > > Sent: Donnerstag, 24. April 2008 04:32 > > To: Oberhuber, Martin > > Cc: rxtx at qbang.org > > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > > > I'm wondering what the status is with RXTX locking > > > serial ports on Linux? > > > > > > My understanding is that the mechanism used in > > > 2.1-7r2 (lockfiles) is not really state of the art, and > > > has lots of problems (e.g. missing permissions). > > > > > > There was an idea to migrate towards a Kernel > > > syscall based solution for port locking. > > > > > > What's the status here? > > > > Hi Martin, > > > > I'm in favor of deprecating the current FHS locking mechanism > > in favor of > > an IOCTL when available. I think it will be available on all the > > platforms but do not know for sure. > > > > The status is unchanged. I've had very few free cycles for > > such things. > > Feel free to take a stab at it if you have some time. I > > believe the IOCTL > > is used in the Mac OS X code already. > > > > I don't see any real backwards compatability issues and the > > IOCTL should > > just work. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Mon Apr 28 04:21:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 28 Apr 2008 04:21:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804281928.34454.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: I don't think there would need to be any architectural changes. A couple ifdefs and minor changes in the current code should be enough. Proposal: FHS/UUCP locks: continue to respect them, try to create them but do not error if the IOCTL is supported. (But does the IOCTL being defined mean it will work?) Enumeration: Do not assert the IOCTL while opening. Serial.open: assert the IOCTL after open. Continue to use locks as described above after asserting the IOCTL. If the IOCTL is defined but not working, handle it here. Failure cases include the IOCTL is not supported and the port is already locked. On Mon, 28 Apr 2008, Stephen Davies wrote: > Has anybody done any design work on this? > The first thing that springs to mind is that we still need to check for lock > files because other apps tend to use that approach even if we go to ioctl. > > Cheers, > Stephen Davies > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: >> Thanks Trent. >> >> Problem is only that I'm really not at all >> Familiar with the C part of RXTX. If there >> Were anything I could do in Java for this, >> It would be easier for me.... >> >> ... Are there any C experts here on the list >> Who'd like to look at ioctl port locking >> For linux? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >>> -----Original Message----- >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] >>> Sent: Donnerstag, 24. April 2008 04:32 >>> To: Oberhuber, Martin >>> Cc: rxtx at qbang.org >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? >>> >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: >>>> Dear RXTX community, >>>> >>>> I'm wondering what the status is with RXTX locking >>>> serial ports on Linux? >>>> >>>> My understanding is that the mechanism used in >>>> 2.1-7r2 (lockfiles) is not really state of the art, and >>>> has lots of problems (e.g. missing permissions). >>>> >>>> There was an idea to migrate towards a Kernel >>>> syscall based solution for port locking. >>>> >>>> What's the status here? >>> >>> Hi Martin, >>> >>> I'm in favor of deprecating the current FHS locking mechanism >>> in favor of >>> an IOCTL when available. I think it will be available on all the >>> platforms but do not know for sure. >>> >>> The status is unchanged. I've had very few free cycles for >>> such things. >>> Feel free to take a stab at it if you have some time. I >>> believe the IOCTL >>> is used in the Mac OS X code already. >>> >>> I don't see any real backwards compatability issues and the >>> IOCTL should >>> just work. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Tue Apr 29 12:04:04 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Apr 2008 20:04:04 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Hi all, The biggest problem that I have seen with lockfiles on Linux At least is, that it seems there is no standard with respect To the folder in which they should be created. Also, many Distributions seem to set up file system permissions in such A way that writing to the lockfile folder is not allowed for The normal user -- that's why we stopped using lockfiles In our commercial product. If we are to still respect lockfiles, we first need to Understand where we are expected to look for them. Does Anybody have any insight what variants of lockfile folder Schema exist out there in the wild? Some apps like minicom Seem to even allow users to manually specify a lockfile Folder of their choice. Because of the difficulty finding the right lockfile folder, And because of the inherent risk of thinking that something Might be locked while it actually isn't, I'd suggest that RXTX should have a "soft-off" feature that allows disabling ALL Lockfile checks at runtime without recompiling the native Sharedlibs. Trent - I like your strategy outline, but I think that it Needs to be configurable by the client such that users and/or Customer Support can disable lockfiles / disable ioctl in Case they detect that they are runing on an OS / Kernal that Does not support one or the other. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Montag, 28. April 2008 12:22 > To: Stephen Davies > Cc: rxtx at qbang.org; Oberhuber, Martin; Trent Jarvi > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > I don't think there would need to be any architectural > changes. A couple > ifdefs and minor changes in the current code should be enough. > > Proposal: > > FHS/UUCP locks: > continue to respect them, try to create them but do not error if > the IOCTL is supported. (But does the IOCTL being defined mean > it will work?) > Enumeration: > Do not assert the IOCTL while opening. > Serial.open: > assert the IOCTL after open. Continue to use locks as described > above after asserting the IOCTL. If the IOCTL is defined but > not working, handle it here. Failure cases include the IOCTL > is not supported and the port is already locked. > > On Mon, 28 Apr 2008, Stephen Davies wrote: > > > Has anybody done any design work on this? > > The first thing that springs to mind is that we still need > to check for lock > > files because other apps tend to use that approach even if > we go to ioctl. > > > > Cheers, > > Stephen Davies > > > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > >> Thanks Trent. > >> > >> Problem is only that I'm really not at all > >> Familiar with the C part of RXTX. If there > >> Were anything I could do in Java for this, > >> It would be easier for me.... > >> > >> ... Are there any C experts here on the list > >> Who'd like to look at ioctl port locking > >> For linux? > >> > >> Thanks, > >> -- > >> Martin Oberhuber, Senior Member of Technical Staff, Wind River > >> Target Management Project Lead, DSDP PMC Member > >> http://www.eclipse.org/dsdp/tm > >> > >>> -----Original Message----- > >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] > >>> Sent: Donnerstag, 24. April 2008 04:32 > >>> To: Oberhuber, Martin > >>> Cc: rxtx at qbang.org > >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? > >>> > >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > >>>> Dear RXTX community, > >>>> > >>>> I'm wondering what the status is with RXTX locking > >>>> serial ports on Linux? > >>>> > >>>> My understanding is that the mechanism used in > >>>> 2.1-7r2 (lockfiles) is not really state of the art, and > >>>> has lots of problems (e.g. missing permissions). > >>>> > >>>> There was an idea to migrate towards a Kernel > >>>> syscall based solution for port locking. > >>>> > >>>> What's the status here? > >>> > >>> Hi Martin, > >>> > >>> I'm in favor of deprecating the current FHS locking mechanism > >>> in favor of > >>> an IOCTL when available. I think it will be available on all the > >>> platforms but do not know for sure. > >>> > >>> The status is unchanged. I've had very few free cycles for > >>> such things. > >>> Feel free to take a stab at it if you have some time. I > >>> believe the IOCTL > >>> is used in the Mac OS X code already. > >>> > >>> I don't see any real backwards compatability issues and the > >>> IOCTL should > >>> just work. > >>> > >>> -- > >>> Trent Jarvi > >>> tjarvi at qbang.org > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > From Steffen.DETTMER at ingenico.com Tue Apr 29 13:34:44 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 29 Apr 2008 21:34:44 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Message-ID: <20080429193444.GU2928@elberon.bln.de.ingenico.com> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > The biggest problem that I have seen with lockfiles on Linux > At least is, that it seems there is no standard with respect > To the folder in which they should be created. Also, many > Distributions seem to set up file system permissions in such > A way that writing to the lockfile folder is not allowed for > The normal user -- that's why we stopped using lockfiles > In our commercial product. It seems it depends on the expectations. I consider it as a feature that by default a linux user cannot access serial ports. Maybe root connected a modem (can produce phone bills) or even some serial card reader, maybe with the web servers key pair. I would expect that by default a user cannot open the serial port because of insufficient permissions on the device file. I would expect this on other unices as well (but I don't know it). For windows I think it should be similar but not impacting so much in practice, because often windows users work with big permissions on a somewhat high priviledge level or even Administrator. > If we are to still respect lockfiles, we first need to > Understand where we are expected to look for them. Does > Anybody have any insight what variants of lockfile folder > Schema exist out there in the wild? Some apps like minicom > Seem to even allow users to manually specify a lockfile > Folder of their choice. At least my (ancient) minicom does not allow the user to change this option, it is displayed but read-only, but root is allowed to change it. > Because of the difficulty finding the right lockfile folder, > And because of the inherent risk of thinking that something > Might be locked while it actually isn't, I'd suggest that > RXTX should have a "soft-off" feature that allows disabling > ALL Lockfile checks at runtime without recompiling the native > Sharedlibs. sounds very reasonable, yes... and as admin I would not wish that users could skip such locking because they do things wrong by default ;) (in the end I guess that is related to the dilemma, that hotplug/user-owned-periphery and multi-user systems simply conflict) > Trent - I like your strategy outline, but I think that it > Needs to be configurable by the client such that users and/or > Customer Support can disable lockfiles / disable ioctl in > Case they detect that they are runing on an OS / Kernal that > Does not support one or the other. Yes, this would be good I guess... Applications could offer configuration options to control that, maybe similarily as minicom. BTW, man minicom tells: *B - Lock file location On most systems This should be /usr/spool/uucp. Linux systems use /var/lock. If this directory does not exist, minicom will not attempt to use lockfiles. The statement `Linux systems use /var/lock' is interesting, does anyone know the source of this convention? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Tue Apr 29 16:11:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Apr 2008 16:11:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? These details are outlined in the Filesystem Hierarchy Standard (FHS). http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLOCKLOCKFILES -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Tue Apr 29 18:58:09 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Wed, 30 Apr 2008 10:28:09 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: <200804301028.09307.scldad@sdc.com.au> I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is the same. Any ideas as to how to handle this? Stephen On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: > * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > > The biggest problem that I have seen with lockfiles on Linux > > At least is, that it seems there is no standard with respect > > To the folder in which they should be created. Also, many > > Distributions seem to set up file system permissions in such > > A way that writing to the lockfile folder is not allowed for > > The normal user -- that's why we stopped using lockfiles > > In our commercial product. > > It seems it depends on the expectations. I consider it as a > feature that by default a linux user cannot access serial ports. > Maybe root connected a modem (can produce phone bills) or even > some serial card reader, maybe with the web servers key pair. > > I would expect that by default a user cannot open the serial port > because of insufficient permissions on the device file. I would > expect this on other unices as well (but I don't know it). > > For windows I think it should be similar but not impacting so > much in practice, because often windows users work with big > permissions on a somewhat high priviledge level or even > Administrator. > > > If we are to still respect lockfiles, we first need to > > Understand where we are expected to look for them. Does > > Anybody have any insight what variants of lockfile folder > > Schema exist out there in the wild? Some apps like minicom > > Seem to even allow users to manually specify a lockfile > > Folder of their choice. > > At least my (ancient) minicom does not allow the user to change > this option, it is displayed but read-only, but root is allowed > to change it. > > > Because of the difficulty finding the right lockfile folder, > > And because of the inherent risk of thinking that something > > Might be locked while it actually isn't, I'd suggest that > > RXTX should have a "soft-off" feature that allows disabling > > ALL Lockfile checks at runtime without recompiling the native > > Sharedlibs. > > sounds very reasonable, yes... > and as admin I would not wish that users could skip such > locking because they do things wrong by default ;) > > (in the end I guess that is related to the dilemma, that > hotplug/user-owned-periphery and multi-user systems simply > conflict) > > > Trent - I like your strategy outline, but I think that it > > Needs to be configurable by the client such that users and/or > > Customer Support can disable lockfiles / disable ioctl in > > Case they detect that they are runing on an OS / Kernal that > > Does not support one or the other. > > Yes, this would be good I guess... Applications could offer > configuration options to control that, maybe similarily as > minicom. > > BTW, man minicom tells: > > *B - Lock file location > On most systems This should be /usr/spool/uucp. > Linux systems use /var/lock. If this directory > does not exist, minicom will not attempt to use > lockfiles. > > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure > and expedient electronic transaction acceptance. Ingenico products leverage > proven technology, established standards and unparalleled ergonomics to > provide optimal reliability, versatility and usability. This comprehensive > range of products is complemented by a global array of services and > partnerships, enabling businesses in a number of vertical sectors to accept > transactions anywhere their business takes them. www.ingenico.com This > message may contain confidential and/or privileged information. If you are > not the addressee or authorized to receive this for the addressee, you must > not use, copy, disclose or take any action based on this message or any > information herein. If you have received this message in error, please > advise the sender immediately by reply e-mail and delete this message. > Thank you for your cooperation. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Wed Apr 30 19:30:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 30 Apr 2008 19:30:51 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804301028.09307.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> <200804301028.09307.scldad@sdc.com.au> Message-ID: Hi Stephen, I suspect ioctl/TIOCEXCL open/O_EXCL would do the job. Mac uses TIOCEXCL and it is POSIX. We use O_EXCL for lockfiles on Linux already. On Wed, 30 Apr 2008, Stephen Davies wrote: > I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is > the same. > > Any ideas as to how to handle this? > > Stephen > > > On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: >> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: >>> The biggest problem that I have seen with lockfiles on Linux >>> At least is, that it seems there is no standard with respect >>> To the folder in which they should be created. Also, many >>> Distributions seem to set up file system permissions in such >>> A way that writing to the lockfile folder is not allowed for >>> The normal user -- that's why we stopped using lockfiles >>> In our commercial product. >> >> It seems it depends on the expectations. I consider it as a >> feature that by default a linux user cannot access serial ports. >> Maybe root connected a modem (can produce phone bills) or even >> some serial card reader, maybe with the web servers key pair. >> >> I would expect that by default a user cannot open the serial port >> because of insufficient permissions on the device file. I would >> expect this on other unices as well (but I don't know it). >> >> For windows I think it should be similar but not impacting so >> much in practice, because often windows users work with big >> permissions on a somewhat high priviledge level or even >> Administrator. >> >>> If we are to still respect lockfiles, we first need to >>> Understand where we are expected to look for them. Does >>> Anybody have any insight what variants of lockfile folder >>> Schema exist out there in the wild? Some apps like minicom >>> Seem to even allow users to manually specify a lockfile >>> Folder of their choice. >> >> At least my (ancient) minicom does not allow the user to change >> this option, it is displayed but read-only, but root is allowed >> to change it. >> >>> Because of the difficulty finding the right lockfile folder, >>> And because of the inherent risk of thinking that something >>> Might be locked while it actually isn't, I'd suggest that >>> RXTX should have a "soft-off" feature that allows disabling >>> ALL Lockfile checks at runtime without recompiling the native >>> Sharedlibs. >> >> sounds very reasonable, yes... >> and as admin I would not wish that users could skip such >> locking because they do things wrong by default ;) >> >> (in the end I guess that is related to the dilemma, that >> hotplug/user-owned-periphery and multi-user systems simply >> conflict) >> >>> Trent - I like your strategy outline, but I think that it >>> Needs to be configurable by the client such that users and/or >>> Customer Support can disable lockfiles / disable ioctl in >>> Case they detect that they are runing on an OS / Kernal that >>> Does not support one or the other. >> >> Yes, this would be good I guess... Applications could offer >> configuration options to control that, maybe similarily as >> minicom. >> >> BTW, man minicom tells: >> >> *B - Lock file location >> On most systems This should be /usr/spool/uucp. >> Linux systems use /var/lock. If this directory >> does not exist, minicom will not attempt to use >> lockfiles. >> >> The statement `Linux systems use /var/lock' is interesting, does >> anyone know the source of this convention? >> >> oki, >> >> Steffen >> >> About Ingenico Throughout the world businesses rely on Ingenico for secure >> and expedient electronic transaction acceptance. Ingenico products leverage >> proven technology, established standards and unparalleled ergonomics to >> provide optimal reliability, versatility and usability. This comprehensive >> range of products is complemented by a global array of services and >> partnerships, enabling businesses in a number of vertical sectors to accept >> transactions anywhere their business takes them. www.ingenico.com This >> message may contain confidential and/or privileged information. If you are >> not the addressee or authorized to receive this for the addressee, you must >> not use, copy, disclose or take any action based on this message or any >> information herein. If you have received this message in error, please >> advise the sender immediately by reply e-mail and delete this message. >> Thank you for your cooperation. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0031.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0029.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0016.html From pboulton at pulsetracer.com Fri Apr 18 14:30:13 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Fri, 18 Apr 2008 13:30:13 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site Message-ID: <480904D5.1060307@pulsetracer.com> Hello, gentle serial porters. I have downloaded the zipped up binaries for use on Windows without Sun's CommAPI, but don't seem able to extract anything from the download. Go to main page, http://www.rxtx.org/ Click on Downloads I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) And I save it to disk. If I try and extract the files with WinZip, Winzip thinks the archive is corrupt. If I try using Windows Explorer, I am able to extract it into a single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than the original .zip. Any help would be much appreciated. Sincerely, Philip Boulton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080418/97d89793/attachment-0014.html From tjarvi at qbang.org Fri Apr 18 19:07:00 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 18 Apr 2008 19:07:00 -0600 (MDT) Subject: [Rxtx] Difficulty opening zip file at rxtx site In-Reply-To: <480904D5.1060307@pulsetracer.com> References: <480904D5.1060307@pulsetracer.com> Message-ID: On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org From pboulton at pulsetracer.com Sat Apr 19 12:46:26 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Sat, 19 Apr 2008 11:46:26 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site References: <480904D5.1060307@pulsetracer.com> Message-ID: <53DB7576450695419E09299104043761A78533@ZTGSERVER.ztg.local> I have been able to get my hands on the binaries, by going to the ftp directory /pub/rxtx at ftp.qbang.org,, and ftping the file rxtx-2.1-7-bins-r2.zip . This opens happily with Winzip, and extracts as the set of files that you describe below. I only experience the ill-formed archive problem by clicking the link on the rxtx.org Downloads page (http://rxtx.qbang.org/pub/rxtx/ rxtx-2.1-7-bins-r2.zip ). Not sure what to make of that. Philip Boulton ________________________________ From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Fri 4/18/2008 6:07 PM To: Philip Boulton Cc: rxtx at qbang.org Subject: Re: [Rxtx] Difficulty opening zip file at rxtx site On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080419/147923bb/attachment-0013.html From jlar310 at gmail.com Sat Apr 19 19:11:55 2008 From: jlar310 at gmail.com (Jeff Larsen) Date: Sat, 19 Apr 2008 20:11:55 -0500 Subject: [Rxtx] Moxa serial over Ethernet driver Message-ID: Hi all, I've been using javax.comm for years to communicate with a legacy radio data system. We want to migrate the java side of the system to a VMware Server virtual machine. We've had great success using Moxa DE-303 and 5610 serial over Ethernet appliances and virtual machines for running hylafax. The OS (Linux in this case) uses a kernel driver to communicate with the Moxa via a virtual serial port such as /dev/ttyr00. I want to do the same thing with javax.comm or gnu.io to connect to a virtual serial port. However I'm hitting road blocks everywhere. javax.comm for Linux sees the virtual port, but there are transmission errors. Tried Solaris too, but the Solaris Moxa drivers don't play nice with javax.comm because the driver uses /dev/pts/n instead of /dev/term/x. Next I tried RXTX on Linux, but I'm getting NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX on Solaris. Has anyone used RXTX with serial over Ethernet devices? Any hints on how to make it work? I know that I'm not completely off track because javax.comm does work with Moxa on a Windows platform, but that's just not an option for production deployment. -- Jeff From tjarvi at qbang.org Sat Apr 19 21:08:41 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 19 Apr 2008 21:08:41 -0600 (MDT) Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: yOn Sat, 19 Apr 2008, Jeff Larsen wrote: > Hi all, > > I've been using javax.comm for years to communicate with a legacy > radio data system. We want to migrate the java side of the system to a > VMware Server virtual machine. We've had great success using Moxa > DE-303 and 5610 serial over Ethernet appliances and virtual machines > for running hylafax. The OS (Linux in this case) uses a kernel driver > to communicate with the Moxa via a virtual serial port such as > /dev/ttyr00. > > I want to do the same thing with javax.comm or gnu.io to connect to a > virtual serial port. However I'm hitting road blocks everywhere. > javax.comm for Linux sees the virtual port, but there are transmission > errors. Tried Solaris too, but the Solaris Moxa drivers don't play > nice with javax.comm because the driver uses /dev/pts/n instead of > /dev/term/x. Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris. > > Has anyone used RXTX with serial over Ethernet devices? Any hints on > how to make it work? > > I know that I'm not completely off track because javax.comm does work > with Moxa on a Windows platform, but that's just not an option for > production deployment. > > Moxa should work under linux. There may be minor issues depending upon how complete the kernel driver is but I think it will work. One of the minor issues is /dev/ttyr00 is not enumerated. There are several work arounds documented with the source code and on the wiki. The easiest solution for testing purposes is to make a symbolic link from /dev/ttyr00 to a port that is enumerated such as /dev/ttyS129. You can later alter the rxtx source or use properties to change the enumerated ports. -- Trent Jarvi tjarvi at qbang.org From d.tonhofer at m-plify.com Sun Apr 20 03:33:30 2008 From: d.tonhofer at m-plify.com (David Tonhofer (M-PLIFY S.A.)) Date: Sun, 20 Apr 2008 11:33:30 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: <480B0DEA.5010908@m-plify.com> Jeff Larsen wrote: > Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris It might be that the Java side of RXTX does not recognize that portname. Trying modifying src/RXTXCommDriver.java as described in this case: http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card From ajmas at sympatico.ca Sun Apr 20 16:37:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Apr 2008 18:37:59 -0400 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <480B0DEA.5010908@m-plify.com> References: <480B0DEA.5010908@m-plify.com> Message-ID: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > Jeff Larsen wrote: >> Next I tried RXTX on Linux, but I'm getting >> NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX >> on Solaris > It might be that the Java side of RXTX does not recognize that > portname. > Trying modifying src/RXTXCommDriver.java as described in this case: > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card I wonder whether it would be worth allowing custom port prefixes as a system parameter? For example: gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" Andre From Martin.Oberhuber at windriver.com Tue Apr 22 12:34:36 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 22 Apr 2008 20:34:36 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> References: <480B0DEA.5010908@m-plify.com> <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE6485848056CD6CE@ism-mail03.corp.ad.wrs.com> Sounds like a great idea... I'm wondering how the "variable part" after the Prefixes could be specified though? What about allowing Regular Expression character Classes in the existing System Property for specifying ports: System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyS[0-9],ttyS[ABC],ttyUSB[0-9a-z]"); The set of allowed patterns would of course need to Be restricted compared to REGEX, because it must be A syntax that supports iterating over it. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Montag, 21. April 2008 00:38 > To: rxtx at qbang.org and Users > Subject: Re: [Rxtx] Moxa serial over Ethernet driver > > > On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > > Jeff Larsen wrote: > >> Next I tried RXTX on Linux, but I'm getting > >> NoSuchPortException connecting to /dev/ttyr00. I have yet > to try RXTX > >> on Solaris > > It might be that the Java side of RXTX does not recognize that > > portname. > > Trying modifying src/RXTXCommDriver.java as described in this case: > > > > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_ > SST-4P.2FLP_multiport_card > > I wonder whether it would be worth allowing custom port > prefixes as a > system parameter? For > example: > > gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Loi.TRAN at weatherford.com Tue Apr 22 13:10:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Tue, 22 Apr 2008 14:10:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled Message-ID: Hi, I'm currently using the Java RXTX API to interface to a serial port. The serial port is connected to a bridge board that communicates with our communications system running at 1.875 Mbps which is linked to an embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no flow control). I send a command to the embedded board through the serial-bridge board which then is relayed to the embedded board. The command sent asks the embedded board to dump a binary image. Here's where I'm hitting some problems. I've successfully done this is an integrated serial port from the laptop. The binary file that comes back is consistent on every attempt. When I use the application I've written to do the same thing with a USB-to-serial adapter, the image I get back is not the same as the image I receive through the USB-to-serial adapter is not consistent at all. A final thing is that when I use a terminal program to dump the binary image with the USB-serial adapter, the image is correct. Every time! What is the terminal program doing that's not being done in my application? My application is quite simple. Has anyone observed this behavior before? If you have, I'd like to know how you've gotten around this problem. Thanks, LT =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From tjarvi at qbang.org Tue Apr 22 21:11:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 22 Apr 2008 21:11:10 -0600 (MDT) Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org From Loi.TRAN at weatherford.com Wed Apr 23 08:35:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Wed, 23 Apr 2008 09:35:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: Thanks for all the responses. I finally tried something that worked consistently. I updated my Prolific driver and repeated my tests. It worked. If you're using the Prolific type USB-serial adapters, do no use the Prolific version 2.0.2.1 driver on Windows. Update it to the latest 2.0.2.8 version. Again, thanks for all the responses. LT -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Tuesday, April 22, 2008 10:11 PM To: TRAN, Loi X. Cc: rxtx at qbang.org Subject: Re: [Rxtx] Prolific USB - RXTX data mangled On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From Martin.Oberhuber at windriver.com Wed Apr 23 18:54:26 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 02:54:26 +0200 Subject: [Rxtx] RXTX port locking on Linux status? Message-ID: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Dear RXTX community, I'm wondering what the status is with RXTX locking serial ports on Linux? My understanding is that the mechanism used in 2.1-7r2 (lockfiles) is not really state of the art, and has lots of problems (e.g. missing permissions). There was an idea to migrate towards a Kernel syscall based solution for port locking. What's the status here? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/9878db9f/attachment-0009.html From tjarvi at qbang.org Wed Apr 23 20:32:24 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Apr 2008 20:32:24 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > Dear RXTX community, > > I'm wondering what the status is with RXTX locking > serial ports on Linux? > > My understanding is that the mechanism used in > 2.1-7r2 (lockfiles) is not really state of the art, and > has lots of problems (e.g. missing permissions). > > There was an idea to migrate towards a Kernel > syscall based solution for port locking. > > What's the status here? > Hi Martin, I'm in favor of deprecating the current FHS locking mechanism in favor of an IOCTL when available. I think it will be available on all the platforms but do not know for sure. The status is unchanged. I've had very few free cycles for such things. Feel free to take a stab at it if you have some time. I believe the IOCTL is used in the Mac OS X code already. I don't see any real backwards compatability issues and the IOCTL should just work. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Apr 24 06:14:06 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 14:14:06 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Thanks Trent. Problem is only that I'm really not at all Familiar with the C part of RXTX. If there Were anything I could do in Java for this, It would be easier for me.... ... Are there any C experts here on the list Who'd like to look at ioctl port locking For linux? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Donnerstag, 24. April 2008 04:32 > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > I'm wondering what the status is with RXTX locking > > serial ports on Linux? > > > > My understanding is that the mechanism used in > > 2.1-7r2 (lockfiles) is not really state of the art, and > > has lots of problems (e.g. missing permissions). > > > > There was an idea to migrate towards a Kernel > > syscall based solution for port locking. > > > > What's the status here? > > > > Hi Martin, > > I'm in favor of deprecating the current FHS locking mechanism > in favor of > an IOCTL when available. I think it will be available on all the > platforms but do not know for sure. > > The status is unchanged. I've had very few free cycles for > such things. > Feel free to take a stab at it if you have some time. I > believe the IOCTL > is used in the Mac OS X code already. > > I don't see any real backwards compatability issues and the > IOCTL should > just work. > > -- > Trent Jarvi > tjarvi at qbang.org > From sspies at sloc.de Thu Apr 24 07:15:36 2008 From: sspies at sloc.de (Sebastian Spies) Date: Thu, 24 Apr 2008 15:15:36 +0200 (CEST) Subject: [Rxtx] rxtx on gumstix: Interrupted system call In-Reply-To: <47FB7B20.7080504@sloc.de> References: <47FB7B20.7080504@sloc.de> Message-ID: <55445.130.83.139.205.1209042936.squirrel@ssl.sloc.de> Dear list, while porting rxtx to the gumstix, I found out, that select used in readArray in SerialImp.c might not work as expected. Maybe, because of missing TIOCSERGETLSR-support? select is often interrupted, so i wrote the following quick'n'dirty hack to make it work on gumstix: diff -Nur rxtx-2.1-7r2/src/SerialImp.c rxtx-2.1-7r2/src/SerialImp.c --- rxtx-2.1-7r2/src/SerialImp.c 2006-01-29 23:19:04.000000000 +0100 +++ rxtx-2.1-7r2-patched/src/SerialImp.c 2008-04-24 14:30:17.000000000 +0200 @@ -3380,7 +3381,7 @@ JNIEXPORT jint JNICALL RXTXPort(readArray)( JNIEnv *env, jobject jobj, jbyteArray jbarray, jint offset, jint length ) { - int bytes; + int bytes = 0; jbyte *body; /* char msg[80]; */ int fd = get_java_var( env, jobj, "fd", "I" ); @@ -3397,9 +3398,18 @@ "readArray", "Invalid length" ); return -1; } - body = (*env)->GetByteArrayElements( env, jbarray, 0 ); - bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ - (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + while(1 > bytes) + { + body = (*env)->GetByteArrayElements( env, jbarray, 0 ); + bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ + (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + // quick'n'dirty - SSP + report (" trying again... \n"); + errno = 0; + } + if( bytes < 0 ) { report( "RXTXPort:readArray bytes < 0" ); LEAVE( "RXTXPort:readArray" ); > Hey, > > I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use > RXTXPort$SerialInputStream.read(), then I get the following Exception. I > did not yet figure out which system call is interrupted as strace > produces loads of output. > > Any help would be very appreciated. Thanks in advance. > Sebastian > > > [java] java.io.IOException: Interrupted system call in readArray > [java] at gnu.io.RXTXPort.readArray(Native Method) > [java] at > gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) > [java] at > java.io.FilterInputStream.read(FilterInputStream.java:189) > [java] at > java.io.BufferedInputStream.refill(BufferedInputStream.java:371) > [java] at > java.io.BufferedInputStream.read(BufferedInputStream.java:229) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) > [java] at > com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) > > -- > Sebastian Spies > > mail: sspies at sloc.de > > > > From fire_baptized at hotmail.com Thu Apr 24 18:27:48 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Thu, 24 Apr 2008 20:27:48 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hello I am having a problem with the serial device connecting (software wise) to the serial port. However I have a test program and it seems to work just fine in that environment - and it doesnt use GUI. The error I am getting is : PortNotFoundException Now the way I have it setup in the GUI environment is that once the user pushes a JButton the program connects using this class: protected void establishConnection() { try { portId = CommPortIdentifier.getPortIdentifier("COM3"); System.out.println("Establishing connction....."); messages[0] = "\nEstablishing connction.....\n"; } catch ( NoSuchPortException noport) { System.out.println("Port not found: "+ noport); messages[0] = "Port not found: "+ noport+"\n"; } try { serialPort = (SerialPort) portId.open("serial", 50); System.out.println("Port has been found."); messages[1] = "Port has been found.\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[1] = "" +usedport; } try { serialPort = (SerialPort) portId.open("serial", 50); messages[2] = "Connecting to COM3 on port 50....\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; } try { serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); System.out.println("Esablishing the transfer rate settings for COM3."); messages[3] = "Esablishing the transfer rate settings for COM3.\n"; } catch (UnsupportedCommOperationException nosupcom) { System.out.println(nosupcom); System.out.println("The tranfer rate could not be esblished on COM3."); messages[3] = "The tranfer rate could not be esblished on COM3.\n"; } System.out.println(serialPort.getFlowControlMode()); messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; //sendDataOut(buffer[3],buffer[4]); } I need all the data in this method (and all the string values in this method) to be printed out on a JTextArea. I wont do me any good if not all the text is printed on a JTextArea in another class. So I have the text printing the JTextArea correctly, but everytime the JButton is activated - it gives me that error message. I did add a disconnect button that is supposed to call the serialPort.close(). _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/273fd4ec/attachment-0008.html From tjarvi at qbang.org Thu Apr 24 21:54:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Apr 2008 21:54:10 -0600 (MDT) Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > Hello I am having a problem with the serial device connecting (software > wise) to the serial port. However I have a test program and it seems to > work just fine in that environment - and it doesnt use GUI. The error I > am getting is : PortNotFoundException Now the way I have it setup in the > GUI environment is that once the user pushes a JButton the program > connects using this class: > > protected void establishConnection() { > try { > portId = CommPortIdentifier.getPortIdentifier("COM3"); > System.out.println("Establishing connction....."); > messages[0] = "\nEstablishing connction.....\n"; > } > catch ( NoSuchPortException noport) { > System.out.println("Port not found: "+ noport); > messages[0] = "Port not found: "+ noport+"\n"; > } > try { > serialPort = (SerialPort) portId.open("serial", 50); > System.out.println("Port has been found."); > messages[1] = "Port has been found.\n"; > } > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[1] = "" +usedport; > } ================================================================= > try { > serialPort = (SerialPort) portId.open("serial", 50); > messages[2] = "Connecting to COM3 on port 50....\n"; > } ================================================================== > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > } > try { > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > System.out.println("Esablishing the transfer rate settings for COM3."); > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > } > catch (UnsupportedCommOperationException nosupcom) { > System.out.println(nosupcom); > System.out.println("The tranfer rate could not be esblished on COM3."); > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > } > System.out.println(serialPort.getFlowControlMode()); > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > //sendDataOut(buffer[3],buffer[4]); > } > > I need all the data in this method (and all the string values in this > method) to be printed out on a JTextArea. I wont do me any good if not > all the text is printed on a JTextArea in another class. So I have the > text printing the JTextArea correctly, but everytime the JButton is > activated - it gives me that error message. I did add a disconnect > button that is supposed to call the serialPort.close(). > The open code used twice is going to throw an exception. It may be that you catch the exception above this code and print a confusing message? A common mistake is people will accidently run two copies of their program. The first instance of the program will open the port and prevent enumeration (finding the port) in the second instance of the program. As an example, you may be running your text based application which is preventing the GUI from seeing the port. Enumeration is done by trying to open the port. If the port is open, Enumeration fails. -- Trent Jarvi tjarvi at qbang.org From fire_baptized at hotmail.com Thu Apr 24 22:32:05 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 00:32:05 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Wow - thanks dude what a dumb thing for me to not catch..... now here is the current problem - right now I am trying to output data again one is with the test program - and it seems that serialPort.setRTS(true); is throwing an exceptions there - now if I show this code please bare in mind that I am only testing - the code is kinda sloppy in my mind - but if I can figure out why calling this function is throwing an exception then maybe I can figure out why my GUI application is getting the same null pointer exceptions when try to send out the data stream. FYI Trent this email is not directed towards you - anyone can jump in on this public static void main(String args[]) { byte[] b = new byte[64]; int keyinput = 0 ; byte x = 0; byte y = 0; PortTesting1 testports = new PortTesting1(); try { joyskoro = Joystick.createInstance(); } catch (IOException ioexc) { System.out.println("There is an input/output problem: " + ioexc); } while (true) { joyskoro.poll(); b[0] = ((byte) -(10 * joyskoro.getY())); b[1] = ((byte) (10 * joyskoro.getX())); System.out.println("The 3rd byte is: " +b[0]); System.out.println("The 4rd byte is: " +b[1]); serialPort.setRTS(true); // HERE IS WHERE THE PROBLEM IS !!!!!!! ON THIS LINE but if I dont have it active in my program the Bluetooth device (that is System.out.println("Ready to send :-) !"); //connected to the serial port does not send out data!!!!! if (joyskoro.isButtonDown(joyskoro.BUTTON10)) { System.out.println("Connection terminated."); serialPort.close(); break; } if (joyskoro.isButtonDown(joyskoro.BUTTON2)) { boolean flag = true; //reading from key input from the keyboard System.out.println("Please input a command: "); while (flag) { try { keyinput = System.in.read(); } catch (IOException ioexc) {/*there is no need to put * anything here */ } if((char)keyinput=='w') { pushIt((byte)85); } if((char)keyinput=='s') { pushIt((byte)84); } if((char)keyinput=='a') { pushIt((byte)83); } if((char)keyinput=='d') { pushIt((byte)82); } if((char)keyinput=='q') { pushIt((byte)89); } if((char)keyinput=='\t') { //this stop reading input from the keyboard flag = false; } } and help anyways here is the block of code that throwing an exception for the test program: > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/5c8f7d68/attachment-0008.html From fire_baptized at hotmail.com Fri Apr 25 07:59:53 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 09:59:53 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Are there any examples of how to push out data? As in using input and output streams - if I can compare code maybe I can see where this is causing a problem. I have a byte array that I am pushing out data. I keep getting null pointer exceptions every where I turn. > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/22228ab6/attachment-0007.html From ajmas at sympatico.ca Sat Apr 26 07:37:09 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 26 Apr 2008 09:37:09 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hi, On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote: > > Are there any examples of how to push out data? As in using input > and output streams - if I can compare code maybe I can see where > this is causing a problem. I have a byte array that I am pushing > out data. I keep getting null pointer exceptions every where I turn. > There are some examples here that might be of help: http://rxtx.qbang.org/wiki/index.php/Examples Andre From fire_baptized at hotmail.com Sat Apr 26 20:13:54 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Sat, 26 Apr 2008 22:13:54 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: looked at those....yep didnt help - I need to push out data with GUI and not get a null pointer exception everytime I try. > CC: rxtx at qbang.org> From: ajmas at sympatico.ca> To: fire_baptized at hotmail.com> Subject: Re: [Rxtx] Serial Problems with Gui.....> Date: Sat, 26 Apr 2008 09:37:09 -0400> > Hi,> > > On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote:> >> > Are there any examples of how to push out data? As in using input > > and output streams - if I can compare code maybe I can see where > > this is causing a problem. I have a byte array that I am pushing > > out data. I keep getting null pointer exceptions every where I turn.> >> > There are some examples here that might be of help:> > http://rxtx.qbang.org/wiki/index.php/Examples> > Andre _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080426/09f95b41/attachment-0006.html From michael.erskine at ketech.com Mon Apr 28 02:47:22 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 28 Apr 2008 09:47:22 +0100 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D426EF3CBBC5@no-sv-03.ketech.local> Jesrael D. Summerhill wrote: > looked at those....yep didnt help - I need to push out data with GUI and > not get a null pointer exception everytime I try. So it seems pretty obvious that your code needs to check for nulls wherever one may occur and report what's happening. Alternatively, catch the npe and display the stack trace. Then you can fix your code so it doesn't try to work with something that ain't there. Regards, Michael Erskine. From scldad at sdc.com.au Mon Apr 28 03:58:34 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Mon, 28 Apr 2008 19:28:34 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Message-ID: <200804281928.34454.scldad@sdc.com.au> Has anybody done any design work on this? The first thing that springs to mind is that we still need to check for lock files because other apps tend to use that approach even if we go to ioctl. Cheers, Stephen Davies On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > Thanks Trent. > > Problem is only that I'm really not at all > Familiar with the C part of RXTX. If there > Were anything I could do in Java for this, > It would be easier for me.... > > ... Are there any C experts here on the list > Who'd like to look at ioctl port locking > For linux? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > -----Original Message----- > > From: Trent Jarvi [mailto:tjarvi at qbang.org] > > Sent: Donnerstag, 24. April 2008 04:32 > > To: Oberhuber, Martin > > Cc: rxtx at qbang.org > > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > > > I'm wondering what the status is with RXTX locking > > > serial ports on Linux? > > > > > > My understanding is that the mechanism used in > > > 2.1-7r2 (lockfiles) is not really state of the art, and > > > has lots of problems (e.g. missing permissions). > > > > > > There was an idea to migrate towards a Kernel > > > syscall based solution for port locking. > > > > > > What's the status here? > > > > Hi Martin, > > > > I'm in favor of deprecating the current FHS locking mechanism > > in favor of > > an IOCTL when available. I think it will be available on all the > > platforms but do not know for sure. > > > > The status is unchanged. I've had very few free cycles for > > such things. > > Feel free to take a stab at it if you have some time. I > > believe the IOCTL > > is used in the Mac OS X code already. > > > > I don't see any real backwards compatability issues and the > > IOCTL should > > just work. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Mon Apr 28 04:21:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 28 Apr 2008 04:21:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804281928.34454.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: I don't think there would need to be any architectural changes. A couple ifdefs and minor changes in the current code should be enough. Proposal: FHS/UUCP locks: continue to respect them, try to create them but do not error if the IOCTL is supported. (But does the IOCTL being defined mean it will work?) Enumeration: Do not assert the IOCTL while opening. Serial.open: assert the IOCTL after open. Continue to use locks as described above after asserting the IOCTL. If the IOCTL is defined but not working, handle it here. Failure cases include the IOCTL is not supported and the port is already locked. On Mon, 28 Apr 2008, Stephen Davies wrote: > Has anybody done any design work on this? > The first thing that springs to mind is that we still need to check for lock > files because other apps tend to use that approach even if we go to ioctl. > > Cheers, > Stephen Davies > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: >> Thanks Trent. >> >> Problem is only that I'm really not at all >> Familiar with the C part of RXTX. If there >> Were anything I could do in Java for this, >> It would be easier for me.... >> >> ... Are there any C experts here on the list >> Who'd like to look at ioctl port locking >> For linux? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >>> -----Original Message----- >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] >>> Sent: Donnerstag, 24. April 2008 04:32 >>> To: Oberhuber, Martin >>> Cc: rxtx at qbang.org >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? >>> >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: >>>> Dear RXTX community, >>>> >>>> I'm wondering what the status is with RXTX locking >>>> serial ports on Linux? >>>> >>>> My understanding is that the mechanism used in >>>> 2.1-7r2 (lockfiles) is not really state of the art, and >>>> has lots of problems (e.g. missing permissions). >>>> >>>> There was an idea to migrate towards a Kernel >>>> syscall based solution for port locking. >>>> >>>> What's the status here? >>> >>> Hi Martin, >>> >>> I'm in favor of deprecating the current FHS locking mechanism >>> in favor of >>> an IOCTL when available. I think it will be available on all the >>> platforms but do not know for sure. >>> >>> The status is unchanged. I've had very few free cycles for >>> such things. >>> Feel free to take a stab at it if you have some time. I >>> believe the IOCTL >>> is used in the Mac OS X code already. >>> >>> I don't see any real backwards compatability issues and the >>> IOCTL should >>> just work. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Tue Apr 29 12:04:04 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Apr 2008 20:04:04 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Hi all, The biggest problem that I have seen with lockfiles on Linux At least is, that it seems there is no standard with respect To the folder in which they should be created. Also, many Distributions seem to set up file system permissions in such A way that writing to the lockfile folder is not allowed for The normal user -- that's why we stopped using lockfiles In our commercial product. If we are to still respect lockfiles, we first need to Understand where we are expected to look for them. Does Anybody have any insight what variants of lockfile folder Schema exist out there in the wild? Some apps like minicom Seem to even allow users to manually specify a lockfile Folder of their choice. Because of the difficulty finding the right lockfile folder, And because of the inherent risk of thinking that something Might be locked while it actually isn't, I'd suggest that RXTX should have a "soft-off" feature that allows disabling ALL Lockfile checks at runtime without recompiling the native Sharedlibs. Trent - I like your strategy outline, but I think that it Needs to be configurable by the client such that users and/or Customer Support can disable lockfiles / disable ioctl in Case they detect that they are runing on an OS / Kernal that Does not support one or the other. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Montag, 28. April 2008 12:22 > To: Stephen Davies > Cc: rxtx at qbang.org; Oberhuber, Martin; Trent Jarvi > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > I don't think there would need to be any architectural > changes. A couple > ifdefs and minor changes in the current code should be enough. > > Proposal: > > FHS/UUCP locks: > continue to respect them, try to create them but do not error if > the IOCTL is supported. (But does the IOCTL being defined mean > it will work?) > Enumeration: > Do not assert the IOCTL while opening. > Serial.open: > assert the IOCTL after open. Continue to use locks as described > above after asserting the IOCTL. If the IOCTL is defined but > not working, handle it here. Failure cases include the IOCTL > is not supported and the port is already locked. > > On Mon, 28 Apr 2008, Stephen Davies wrote: > > > Has anybody done any design work on this? > > The first thing that springs to mind is that we still need > to check for lock > > files because other apps tend to use that approach even if > we go to ioctl. > > > > Cheers, > > Stephen Davies > > > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > >> Thanks Trent. > >> > >> Problem is only that I'm really not at all > >> Familiar with the C part of RXTX. If there > >> Were anything I could do in Java for this, > >> It would be easier for me.... > >> > >> ... Are there any C experts here on the list > >> Who'd like to look at ioctl port locking > >> For linux? > >> > >> Thanks, > >> -- > >> Martin Oberhuber, Senior Member of Technical Staff, Wind River > >> Target Management Project Lead, DSDP PMC Member > >> http://www.eclipse.org/dsdp/tm > >> > >>> -----Original Message----- > >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] > >>> Sent: Donnerstag, 24. April 2008 04:32 > >>> To: Oberhuber, Martin > >>> Cc: rxtx at qbang.org > >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? > >>> > >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > >>>> Dear RXTX community, > >>>> > >>>> I'm wondering what the status is with RXTX locking > >>>> serial ports on Linux? > >>>> > >>>> My understanding is that the mechanism used in > >>>> 2.1-7r2 (lockfiles) is not really state of the art, and > >>>> has lots of problems (e.g. missing permissions). > >>>> > >>>> There was an idea to migrate towards a Kernel > >>>> syscall based solution for port locking. > >>>> > >>>> What's the status here? > >>> > >>> Hi Martin, > >>> > >>> I'm in favor of deprecating the current FHS locking mechanism > >>> in favor of > >>> an IOCTL when available. I think it will be available on all the > >>> platforms but do not know for sure. > >>> > >>> The status is unchanged. I've had very few free cycles for > >>> such things. > >>> Feel free to take a stab at it if you have some time. I > >>> believe the IOCTL > >>> is used in the Mac OS X code already. > >>> > >>> I don't see any real backwards compatability issues and the > >>> IOCTL should > >>> just work. > >>> > >>> -- > >>> Trent Jarvi > >>> tjarvi at qbang.org > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > From Steffen.DETTMER at ingenico.com Tue Apr 29 13:34:44 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 29 Apr 2008 21:34:44 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Message-ID: <20080429193444.GU2928@elberon.bln.de.ingenico.com> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > The biggest problem that I have seen with lockfiles on Linux > At least is, that it seems there is no standard with respect > To the folder in which they should be created. Also, many > Distributions seem to set up file system permissions in such > A way that writing to the lockfile folder is not allowed for > The normal user -- that's why we stopped using lockfiles > In our commercial product. It seems it depends on the expectations. I consider it as a feature that by default a linux user cannot access serial ports. Maybe root connected a modem (can produce phone bills) or even some serial card reader, maybe with the web servers key pair. I would expect that by default a user cannot open the serial port because of insufficient permissions on the device file. I would expect this on other unices as well (but I don't know it). For windows I think it should be similar but not impacting so much in practice, because often windows users work with big permissions on a somewhat high priviledge level or even Administrator. > If we are to still respect lockfiles, we first need to > Understand where we are expected to look for them. Does > Anybody have any insight what variants of lockfile folder > Schema exist out there in the wild? Some apps like minicom > Seem to even allow users to manually specify a lockfile > Folder of their choice. At least my (ancient) minicom does not allow the user to change this option, it is displayed but read-only, but root is allowed to change it. > Because of the difficulty finding the right lockfile folder, > And because of the inherent risk of thinking that something > Might be locked while it actually isn't, I'd suggest that > RXTX should have a "soft-off" feature that allows disabling > ALL Lockfile checks at runtime without recompiling the native > Sharedlibs. sounds very reasonable, yes... and as admin I would not wish that users could skip such locking because they do things wrong by default ;) (in the end I guess that is related to the dilemma, that hotplug/user-owned-periphery and multi-user systems simply conflict) > Trent - I like your strategy outline, but I think that it > Needs to be configurable by the client such that users and/or > Customer Support can disable lockfiles / disable ioctl in > Case they detect that they are runing on an OS / Kernal that > Does not support one or the other. Yes, this would be good I guess... Applications could offer configuration options to control that, maybe similarily as minicom. BTW, man minicom tells: *B - Lock file location On most systems This should be /usr/spool/uucp. Linux systems use /var/lock. If this directory does not exist, minicom will not attempt to use lockfiles. The statement `Linux systems use /var/lock' is interesting, does anyone know the source of this convention? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Tue Apr 29 16:11:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Apr 2008 16:11:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? These details are outlined in the Filesystem Hierarchy Standard (FHS). http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLOCKLOCKFILES -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Tue Apr 29 18:58:09 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Wed, 30 Apr 2008 10:28:09 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: <200804301028.09307.scldad@sdc.com.au> I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is the same. Any ideas as to how to handle this? Stephen On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: > * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > > The biggest problem that I have seen with lockfiles on Linux > > At least is, that it seems there is no standard with respect > > To the folder in which they should be created. Also, many > > Distributions seem to set up file system permissions in such > > A way that writing to the lockfile folder is not allowed for > > The normal user -- that's why we stopped using lockfiles > > In our commercial product. > > It seems it depends on the expectations. I consider it as a > feature that by default a linux user cannot access serial ports. > Maybe root connected a modem (can produce phone bills) or even > some serial card reader, maybe with the web servers key pair. > > I would expect that by default a user cannot open the serial port > because of insufficient permissions on the device file. I would > expect this on other unices as well (but I don't know it). > > For windows I think it should be similar but not impacting so > much in practice, because often windows users work with big > permissions on a somewhat high priviledge level or even > Administrator. > > > If we are to still respect lockfiles, we first need to > > Understand where we are expected to look for them. Does > > Anybody have any insight what variants of lockfile folder > > Schema exist out there in the wild? Some apps like minicom > > Seem to even allow users to manually specify a lockfile > > Folder of their choice. > > At least my (ancient) minicom does not allow the user to change > this option, it is displayed but read-only, but root is allowed > to change it. > > > Because of the difficulty finding the right lockfile folder, > > And because of the inherent risk of thinking that something > > Might be locked while it actually isn't, I'd suggest that > > RXTX should have a "soft-off" feature that allows disabling > > ALL Lockfile checks at runtime without recompiling the native > > Sharedlibs. > > sounds very reasonable, yes... > and as admin I would not wish that users could skip such > locking because they do things wrong by default ;) > > (in the end I guess that is related to the dilemma, that > hotplug/user-owned-periphery and multi-user systems simply > conflict) > > > Trent - I like your strategy outline, but I think that it > > Needs to be configurable by the client such that users and/or > > Customer Support can disable lockfiles / disable ioctl in > > Case they detect that they are runing on an OS / Kernal that > > Does not support one or the other. > > Yes, this would be good I guess... Applications could offer > configuration options to control that, maybe similarily as > minicom. > > BTW, man minicom tells: > > *B - Lock file location > On most systems This should be /usr/spool/uucp. > Linux systems use /var/lock. If this directory > does not exist, minicom will not attempt to use > lockfiles. > > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure > and expedient electronic transaction acceptance. Ingenico products leverage > proven technology, established standards and unparalleled ergonomics to > provide optimal reliability, versatility and usability. This comprehensive > range of products is complemented by a global array of services and > partnerships, enabling businesses in a number of vertical sectors to accept > transactions anywhere their business takes them. www.ingenico.com This > message may contain confidential and/or privileged information. If you are > not the addressee or authorized to receive this for the addressee, you must > not use, copy, disclose or take any action based on this message or any > information herein. If you have received this message in error, please > advise the sender immediately by reply e-mail and delete this message. > Thank you for your cooperation. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Wed Apr 30 19:30:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 30 Apr 2008 19:30:51 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804301028.09307.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> <200804301028.09307.scldad@sdc.com.au> Message-ID: Hi Stephen, I suspect ioctl/TIOCEXCL open/O_EXCL would do the job. Mac uses TIOCEXCL and it is POSIX. We use O_EXCL for lockfiles on Linux already. On Wed, 30 Apr 2008, Stephen Davies wrote: > I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is > the same. > > Any ideas as to how to handle this? > > Stephen > > > On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: >> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: >>> The biggest problem that I have seen with lockfiles on Linux >>> At least is, that it seems there is no standard with respect >>> To the folder in which they should be created. Also, many >>> Distributions seem to set up file system permissions in such >>> A way that writing to the lockfile folder is not allowed for >>> The normal user -- that's why we stopped using lockfiles >>> In our commercial product. >> >> It seems it depends on the expectations. I consider it as a >> feature that by default a linux user cannot access serial ports. >> Maybe root connected a modem (can produce phone bills) or even >> some serial card reader, maybe with the web servers key pair. >> >> I would expect that by default a user cannot open the serial port >> because of insufficient permissions on the device file. I would >> expect this on other unices as well (but I don't know it). >> >> For windows I think it should be similar but not impacting so >> much in practice, because often windows users work with big >> permissions on a somewhat high priviledge level or even >> Administrator. >> >>> If we are to still respect lockfiles, we first need to >>> Understand where we are expected to look for them. Does >>> Anybody have any insight what variants of lockfile folder >>> Schema exist out there in the wild? Some apps like minicom >>> Seem to even allow users to manually specify a lockfile >>> Folder of their choice. >> >> At least my (ancient) minicom does not allow the user to change >> this option, it is displayed but read-only, but root is allowed >> to change it. >> >>> Because of the difficulty finding the right lockfile folder, >>> And because of the inherent risk of thinking that something >>> Might be locked while it actually isn't, I'd suggest that >>> RXTX should have a "soft-off" feature that allows disabling >>> ALL Lockfile checks at runtime without recompiling the native >>> Sharedlibs. >> >> sounds very reasonable, yes... >> and as admin I would not wish that users could skip such >> locking because they do things wrong by default ;) >> >> (in the end I guess that is related to the dilemma, that >> hotplug/user-owned-periphery and multi-user systems simply >> conflict) >> >>> Trent - I like your strategy outline, but I think that it >>> Needs to be configurable by the client such that users and/or >>> Customer Support can disable lockfiles / disable ioctl in >>> Case they detect that they are runing on an OS / Kernal that >>> Does not support one or the other. >> >> Yes, this would be good I guess... Applications could offer >> configuration options to control that, maybe similarily as >> minicom. >> >> BTW, man minicom tells: >> >> *B - Lock file location >> On most systems This should be /usr/spool/uucp. >> Linux systems use /var/lock. If this directory >> does not exist, minicom will not attempt to use >> lockfiles. >> >> The statement `Linux systems use /var/lock' is interesting, does >> anyone know the source of this convention? >> >> oki, >> >> Steffen >> >> About Ingenico Throughout the world businesses rely on Ingenico for secure >> and expedient electronic transaction acceptance. Ingenico products leverage >> proven technology, established standards and unparalleled ergonomics to >> provide optimal reliability, versatility and usability. This comprehensive >> range of products is complemented by a global array of services and >> partnerships, enabling businesses in a number of vertical sectors to accept >> transactions anywhere their business takes them. www.ingenico.com This >> message may contain confidential and/or privileged information. If you are >> not the addressee or authorized to receive this for the addressee, you must >> not use, copy, disclose or take any action based on this message or any >> information herein. If you have received this message in error, please >> advise the sender immediately by reply e-mail and delete this message. >> Thank you for your cooperation. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0032.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0030.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0017.html From pboulton at pulsetracer.com Fri Apr 18 14:30:13 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Fri, 18 Apr 2008 13:30:13 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site Message-ID: <480904D5.1060307@pulsetracer.com> Hello, gentle serial porters. I have downloaded the zipped up binaries for use on Windows without Sun's CommAPI, but don't seem able to extract anything from the download. Go to main page, http://www.rxtx.org/ Click on Downloads I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) And I save it to disk. If I try and extract the files with WinZip, Winzip thinks the archive is corrupt. If I try using Windows Explorer, I am able to extract it into a single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than the original .zip. Any help would be much appreciated. Sincerely, Philip Boulton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080418/97d89793/attachment-0015.html From tjarvi at qbang.org Fri Apr 18 19:07:00 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 18 Apr 2008 19:07:00 -0600 (MDT) Subject: [Rxtx] Difficulty opening zip file at rxtx site In-Reply-To: <480904D5.1060307@pulsetracer.com> References: <480904D5.1060307@pulsetracer.com> Message-ID: On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org From pboulton at pulsetracer.com Sat Apr 19 12:46:26 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Sat, 19 Apr 2008 11:46:26 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site References: <480904D5.1060307@pulsetracer.com> Message-ID: <53DB7576450695419E09299104043761A78533@ZTGSERVER.ztg.local> I have been able to get my hands on the binaries, by going to the ftp directory /pub/rxtx at ftp.qbang.org,, and ftping the file rxtx-2.1-7-bins-r2.zip . This opens happily with Winzip, and extracts as the set of files that you describe below. I only experience the ill-formed archive problem by clicking the link on the rxtx.org Downloads page (http://rxtx.qbang.org/pub/rxtx/ rxtx-2.1-7-bins-r2.zip ). Not sure what to make of that. Philip Boulton ________________________________ From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Fri 4/18/2008 6:07 PM To: Philip Boulton Cc: rxtx at qbang.org Subject: Re: [Rxtx] Difficulty opening zip file at rxtx site On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080419/147923bb/attachment-0014.html From jlar310 at gmail.com Sat Apr 19 19:11:55 2008 From: jlar310 at gmail.com (Jeff Larsen) Date: Sat, 19 Apr 2008 20:11:55 -0500 Subject: [Rxtx] Moxa serial over Ethernet driver Message-ID: Hi all, I've been using javax.comm for years to communicate with a legacy radio data system. We want to migrate the java side of the system to a VMware Server virtual machine. We've had great success using Moxa DE-303 and 5610 serial over Ethernet appliances and virtual machines for running hylafax. The OS (Linux in this case) uses a kernel driver to communicate with the Moxa via a virtual serial port such as /dev/ttyr00. I want to do the same thing with javax.comm or gnu.io to connect to a virtual serial port. However I'm hitting road blocks everywhere. javax.comm for Linux sees the virtual port, but there are transmission errors. Tried Solaris too, but the Solaris Moxa drivers don't play nice with javax.comm because the driver uses /dev/pts/n instead of /dev/term/x. Next I tried RXTX on Linux, but I'm getting NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX on Solaris. Has anyone used RXTX with serial over Ethernet devices? Any hints on how to make it work? I know that I'm not completely off track because javax.comm does work with Moxa on a Windows platform, but that's just not an option for production deployment. -- Jeff From tjarvi at qbang.org Sat Apr 19 21:08:41 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 19 Apr 2008 21:08:41 -0600 (MDT) Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: yOn Sat, 19 Apr 2008, Jeff Larsen wrote: > Hi all, > > I've been using javax.comm for years to communicate with a legacy > radio data system. We want to migrate the java side of the system to a > VMware Server virtual machine. We've had great success using Moxa > DE-303 and 5610 serial over Ethernet appliances and virtual machines > for running hylafax. The OS (Linux in this case) uses a kernel driver > to communicate with the Moxa via a virtual serial port such as > /dev/ttyr00. > > I want to do the same thing with javax.comm or gnu.io to connect to a > virtual serial port. However I'm hitting road blocks everywhere. > javax.comm for Linux sees the virtual port, but there are transmission > errors. Tried Solaris too, but the Solaris Moxa drivers don't play > nice with javax.comm because the driver uses /dev/pts/n instead of > /dev/term/x. Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris. > > Has anyone used RXTX with serial over Ethernet devices? Any hints on > how to make it work? > > I know that I'm not completely off track because javax.comm does work > with Moxa on a Windows platform, but that's just not an option for > production deployment. > > Moxa should work under linux. There may be minor issues depending upon how complete the kernel driver is but I think it will work. One of the minor issues is /dev/ttyr00 is not enumerated. There are several work arounds documented with the source code and on the wiki. The easiest solution for testing purposes is to make a symbolic link from /dev/ttyr00 to a port that is enumerated such as /dev/ttyS129. You can later alter the rxtx source or use properties to change the enumerated ports. -- Trent Jarvi tjarvi at qbang.org From d.tonhofer at m-plify.com Sun Apr 20 03:33:30 2008 From: d.tonhofer at m-plify.com (David Tonhofer (M-PLIFY S.A.)) Date: Sun, 20 Apr 2008 11:33:30 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: <480B0DEA.5010908@m-plify.com> Jeff Larsen wrote: > Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris It might be that the Java side of RXTX does not recognize that portname. Trying modifying src/RXTXCommDriver.java as described in this case: http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card From ajmas at sympatico.ca Sun Apr 20 16:37:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Apr 2008 18:37:59 -0400 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <480B0DEA.5010908@m-plify.com> References: <480B0DEA.5010908@m-plify.com> Message-ID: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > Jeff Larsen wrote: >> Next I tried RXTX on Linux, but I'm getting >> NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX >> on Solaris > It might be that the Java side of RXTX does not recognize that > portname. > Trying modifying src/RXTXCommDriver.java as described in this case: > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card I wonder whether it would be worth allowing custom port prefixes as a system parameter? For example: gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" Andre From Martin.Oberhuber at windriver.com Tue Apr 22 12:34:36 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 22 Apr 2008 20:34:36 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> References: <480B0DEA.5010908@m-plify.com> <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE6485848056CD6CE@ism-mail03.corp.ad.wrs.com> Sounds like a great idea... I'm wondering how the "variable part" after the Prefixes could be specified though? What about allowing Regular Expression character Classes in the existing System Property for specifying ports: System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyS[0-9],ttyS[ABC],ttyUSB[0-9a-z]"); The set of allowed patterns would of course need to Be restricted compared to REGEX, because it must be A syntax that supports iterating over it. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Montag, 21. April 2008 00:38 > To: rxtx at qbang.org and Users > Subject: Re: [Rxtx] Moxa serial over Ethernet driver > > > On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > > Jeff Larsen wrote: > >> Next I tried RXTX on Linux, but I'm getting > >> NoSuchPortException connecting to /dev/ttyr00. I have yet > to try RXTX > >> on Solaris > > It might be that the Java side of RXTX does not recognize that > > portname. > > Trying modifying src/RXTXCommDriver.java as described in this case: > > > > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_ > SST-4P.2FLP_multiport_card > > I wonder whether it would be worth allowing custom port > prefixes as a > system parameter? For > example: > > gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Loi.TRAN at weatherford.com Tue Apr 22 13:10:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Tue, 22 Apr 2008 14:10:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled Message-ID: Hi, I'm currently using the Java RXTX API to interface to a serial port. The serial port is connected to a bridge board that communicates with our communications system running at 1.875 Mbps which is linked to an embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no flow control). I send a command to the embedded board through the serial-bridge board which then is relayed to the embedded board. The command sent asks the embedded board to dump a binary image. Here's where I'm hitting some problems. I've successfully done this is an integrated serial port from the laptop. The binary file that comes back is consistent on every attempt. When I use the application I've written to do the same thing with a USB-to-serial adapter, the image I get back is not the same as the image I receive through the USB-to-serial adapter is not consistent at all. A final thing is that when I use a terminal program to dump the binary image with the USB-serial adapter, the image is correct. Every time! What is the terminal program doing that's not being done in my application? My application is quite simple. Has anyone observed this behavior before? If you have, I'd like to know how you've gotten around this problem. Thanks, LT =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From tjarvi at qbang.org Tue Apr 22 21:11:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 22 Apr 2008 21:11:10 -0600 (MDT) Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org From Loi.TRAN at weatherford.com Wed Apr 23 08:35:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Wed, 23 Apr 2008 09:35:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: Thanks for all the responses. I finally tried something that worked consistently. I updated my Prolific driver and repeated my tests. It worked. If you're using the Prolific type USB-serial adapters, do no use the Prolific version 2.0.2.1 driver on Windows. Update it to the latest 2.0.2.8 version. Again, thanks for all the responses. LT -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Tuesday, April 22, 2008 10:11 PM To: TRAN, Loi X. Cc: rxtx at qbang.org Subject: Re: [Rxtx] Prolific USB - RXTX data mangled On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From Martin.Oberhuber at windriver.com Wed Apr 23 18:54:26 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 02:54:26 +0200 Subject: [Rxtx] RXTX port locking on Linux status? Message-ID: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Dear RXTX community, I'm wondering what the status is with RXTX locking serial ports on Linux? My understanding is that the mechanism used in 2.1-7r2 (lockfiles) is not really state of the art, and has lots of problems (e.g. missing permissions). There was an idea to migrate towards a Kernel syscall based solution for port locking. What's the status here? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/9878db9f/attachment-0010.html From tjarvi at qbang.org Wed Apr 23 20:32:24 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Apr 2008 20:32:24 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > Dear RXTX community, > > I'm wondering what the status is with RXTX locking > serial ports on Linux? > > My understanding is that the mechanism used in > 2.1-7r2 (lockfiles) is not really state of the art, and > has lots of problems (e.g. missing permissions). > > There was an idea to migrate towards a Kernel > syscall based solution for port locking. > > What's the status here? > Hi Martin, I'm in favor of deprecating the current FHS locking mechanism in favor of an IOCTL when available. I think it will be available on all the platforms but do not know for sure. The status is unchanged. I've had very few free cycles for such things. Feel free to take a stab at it if you have some time. I believe the IOCTL is used in the Mac OS X code already. I don't see any real backwards compatability issues and the IOCTL should just work. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Apr 24 06:14:06 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 14:14:06 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Thanks Trent. Problem is only that I'm really not at all Familiar with the C part of RXTX. If there Were anything I could do in Java for this, It would be easier for me.... ... Are there any C experts here on the list Who'd like to look at ioctl port locking For linux? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Donnerstag, 24. April 2008 04:32 > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > I'm wondering what the status is with RXTX locking > > serial ports on Linux? > > > > My understanding is that the mechanism used in > > 2.1-7r2 (lockfiles) is not really state of the art, and > > has lots of problems (e.g. missing permissions). > > > > There was an idea to migrate towards a Kernel > > syscall based solution for port locking. > > > > What's the status here? > > > > Hi Martin, > > I'm in favor of deprecating the current FHS locking mechanism > in favor of > an IOCTL when available. I think it will be available on all the > platforms but do not know for sure. > > The status is unchanged. I've had very few free cycles for > such things. > Feel free to take a stab at it if you have some time. I > believe the IOCTL > is used in the Mac OS X code already. > > I don't see any real backwards compatability issues and the > IOCTL should > just work. > > -- > Trent Jarvi > tjarvi at qbang.org > From sspies at sloc.de Thu Apr 24 07:15:36 2008 From: sspies at sloc.de (Sebastian Spies) Date: Thu, 24 Apr 2008 15:15:36 +0200 (CEST) Subject: [Rxtx] rxtx on gumstix: Interrupted system call In-Reply-To: <47FB7B20.7080504@sloc.de> References: <47FB7B20.7080504@sloc.de> Message-ID: <55445.130.83.139.205.1209042936.squirrel@ssl.sloc.de> Dear list, while porting rxtx to the gumstix, I found out, that select used in readArray in SerialImp.c might not work as expected. Maybe, because of missing TIOCSERGETLSR-support? select is often interrupted, so i wrote the following quick'n'dirty hack to make it work on gumstix: diff -Nur rxtx-2.1-7r2/src/SerialImp.c rxtx-2.1-7r2/src/SerialImp.c --- rxtx-2.1-7r2/src/SerialImp.c 2006-01-29 23:19:04.000000000 +0100 +++ rxtx-2.1-7r2-patched/src/SerialImp.c 2008-04-24 14:30:17.000000000 +0200 @@ -3380,7 +3381,7 @@ JNIEXPORT jint JNICALL RXTXPort(readArray)( JNIEnv *env, jobject jobj, jbyteArray jbarray, jint offset, jint length ) { - int bytes; + int bytes = 0; jbyte *body; /* char msg[80]; */ int fd = get_java_var( env, jobj, "fd", "I" ); @@ -3397,9 +3398,18 @@ "readArray", "Invalid length" ); return -1; } - body = (*env)->GetByteArrayElements( env, jbarray, 0 ); - bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ - (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + while(1 > bytes) + { + body = (*env)->GetByteArrayElements( env, jbarray, 0 ); + bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ + (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + // quick'n'dirty - SSP + report (" trying again... \n"); + errno = 0; + } + if( bytes < 0 ) { report( "RXTXPort:readArray bytes < 0" ); LEAVE( "RXTXPort:readArray" ); > Hey, > > I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use > RXTXPort$SerialInputStream.read(), then I get the following Exception. I > did not yet figure out which system call is interrupted as strace > produces loads of output. > > Any help would be very appreciated. Thanks in advance. > Sebastian > > > [java] java.io.IOException: Interrupted system call in readArray > [java] at gnu.io.RXTXPort.readArray(Native Method) > [java] at > gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) > [java] at > java.io.FilterInputStream.read(FilterInputStream.java:189) > [java] at > java.io.BufferedInputStream.refill(BufferedInputStream.java:371) > [java] at > java.io.BufferedInputStream.read(BufferedInputStream.java:229) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) > [java] at > com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) > > -- > Sebastian Spies > > mail: sspies at sloc.de > > > > From fire_baptized at hotmail.com Thu Apr 24 18:27:48 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Thu, 24 Apr 2008 20:27:48 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hello I am having a problem with the serial device connecting (software wise) to the serial port. However I have a test program and it seems to work just fine in that environment - and it doesnt use GUI. The error I am getting is : PortNotFoundException Now the way I have it setup in the GUI environment is that once the user pushes a JButton the program connects using this class: protected void establishConnection() { try { portId = CommPortIdentifier.getPortIdentifier("COM3"); System.out.println("Establishing connction....."); messages[0] = "\nEstablishing connction.....\n"; } catch ( NoSuchPortException noport) { System.out.println("Port not found: "+ noport); messages[0] = "Port not found: "+ noport+"\n"; } try { serialPort = (SerialPort) portId.open("serial", 50); System.out.println("Port has been found."); messages[1] = "Port has been found.\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[1] = "" +usedport; } try { serialPort = (SerialPort) portId.open("serial", 50); messages[2] = "Connecting to COM3 on port 50....\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; } try { serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); System.out.println("Esablishing the transfer rate settings for COM3."); messages[3] = "Esablishing the transfer rate settings for COM3.\n"; } catch (UnsupportedCommOperationException nosupcom) { System.out.println(nosupcom); System.out.println("The tranfer rate could not be esblished on COM3."); messages[3] = "The tranfer rate could not be esblished on COM3.\n"; } System.out.println(serialPort.getFlowControlMode()); messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; //sendDataOut(buffer[3],buffer[4]); } I need all the data in this method (and all the string values in this method) to be printed out on a JTextArea. I wont do me any good if not all the text is printed on a JTextArea in another class. So I have the text printing the JTextArea correctly, but everytime the JButton is activated - it gives me that error message. I did add a disconnect button that is supposed to call the serialPort.close(). _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/273fd4ec/attachment-0009.html From tjarvi at qbang.org Thu Apr 24 21:54:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Apr 2008 21:54:10 -0600 (MDT) Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > Hello I am having a problem with the serial device connecting (software > wise) to the serial port. However I have a test program and it seems to > work just fine in that environment - and it doesnt use GUI. The error I > am getting is : PortNotFoundException Now the way I have it setup in the > GUI environment is that once the user pushes a JButton the program > connects using this class: > > protected void establishConnection() { > try { > portId = CommPortIdentifier.getPortIdentifier("COM3"); > System.out.println("Establishing connction....."); > messages[0] = "\nEstablishing connction.....\n"; > } > catch ( NoSuchPortException noport) { > System.out.println("Port not found: "+ noport); > messages[0] = "Port not found: "+ noport+"\n"; > } > try { > serialPort = (SerialPort) portId.open("serial", 50); > System.out.println("Port has been found."); > messages[1] = "Port has been found.\n"; > } > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[1] = "" +usedport; > } ================================================================= > try { > serialPort = (SerialPort) portId.open("serial", 50); > messages[2] = "Connecting to COM3 on port 50....\n"; > } ================================================================== > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > } > try { > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > System.out.println("Esablishing the transfer rate settings for COM3."); > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > } > catch (UnsupportedCommOperationException nosupcom) { > System.out.println(nosupcom); > System.out.println("The tranfer rate could not be esblished on COM3."); > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > } > System.out.println(serialPort.getFlowControlMode()); > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > //sendDataOut(buffer[3],buffer[4]); > } > > I need all the data in this method (and all the string values in this > method) to be printed out on a JTextArea. I wont do me any good if not > all the text is printed on a JTextArea in another class. So I have the > text printing the JTextArea correctly, but everytime the JButton is > activated - it gives me that error message. I did add a disconnect > button that is supposed to call the serialPort.close(). > The open code used twice is going to throw an exception. It may be that you catch the exception above this code and print a confusing message? A common mistake is people will accidently run two copies of their program. The first instance of the program will open the port and prevent enumeration (finding the port) in the second instance of the program. As an example, you may be running your text based application which is preventing the GUI from seeing the port. Enumeration is done by trying to open the port. If the port is open, Enumeration fails. -- Trent Jarvi tjarvi at qbang.org From fire_baptized at hotmail.com Thu Apr 24 22:32:05 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 00:32:05 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Wow - thanks dude what a dumb thing for me to not catch..... now here is the current problem - right now I am trying to output data again one is with the test program - and it seems that serialPort.setRTS(true); is throwing an exceptions there - now if I show this code please bare in mind that I am only testing - the code is kinda sloppy in my mind - but if I can figure out why calling this function is throwing an exception then maybe I can figure out why my GUI application is getting the same null pointer exceptions when try to send out the data stream. FYI Trent this email is not directed towards you - anyone can jump in on this public static void main(String args[]) { byte[] b = new byte[64]; int keyinput = 0 ; byte x = 0; byte y = 0; PortTesting1 testports = new PortTesting1(); try { joyskoro = Joystick.createInstance(); } catch (IOException ioexc) { System.out.println("There is an input/output problem: " + ioexc); } while (true) { joyskoro.poll(); b[0] = ((byte) -(10 * joyskoro.getY())); b[1] = ((byte) (10 * joyskoro.getX())); System.out.println("The 3rd byte is: " +b[0]); System.out.println("The 4rd byte is: " +b[1]); serialPort.setRTS(true); // HERE IS WHERE THE PROBLEM IS !!!!!!! ON THIS LINE but if I dont have it active in my program the Bluetooth device (that is System.out.println("Ready to send :-) !"); //connected to the serial port does not send out data!!!!! if (joyskoro.isButtonDown(joyskoro.BUTTON10)) { System.out.println("Connection terminated."); serialPort.close(); break; } if (joyskoro.isButtonDown(joyskoro.BUTTON2)) { boolean flag = true; //reading from key input from the keyboard System.out.println("Please input a command: "); while (flag) { try { keyinput = System.in.read(); } catch (IOException ioexc) {/*there is no need to put * anything here */ } if((char)keyinput=='w') { pushIt((byte)85); } if((char)keyinput=='s') { pushIt((byte)84); } if((char)keyinput=='a') { pushIt((byte)83); } if((char)keyinput=='d') { pushIt((byte)82); } if((char)keyinput=='q') { pushIt((byte)89); } if((char)keyinput=='\t') { //this stop reading input from the keyboard flag = false; } } and help anyways here is the block of code that throwing an exception for the test program: > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/5c8f7d68/attachment-0009.html From fire_baptized at hotmail.com Fri Apr 25 07:59:53 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 09:59:53 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Are there any examples of how to push out data? As in using input and output streams - if I can compare code maybe I can see where this is causing a problem. I have a byte array that I am pushing out data. I keep getting null pointer exceptions every where I turn. > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/22228ab6/attachment-0008.html From ajmas at sympatico.ca Sat Apr 26 07:37:09 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 26 Apr 2008 09:37:09 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hi, On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote: > > Are there any examples of how to push out data? As in using input > and output streams - if I can compare code maybe I can see where > this is causing a problem. I have a byte array that I am pushing > out data. I keep getting null pointer exceptions every where I turn. > There are some examples here that might be of help: http://rxtx.qbang.org/wiki/index.php/Examples Andre From fire_baptized at hotmail.com Sat Apr 26 20:13:54 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Sat, 26 Apr 2008 22:13:54 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: looked at those....yep didnt help - I need to push out data with GUI and not get a null pointer exception everytime I try. > CC: rxtx at qbang.org> From: ajmas at sympatico.ca> To: fire_baptized at hotmail.com> Subject: Re: [Rxtx] Serial Problems with Gui.....> Date: Sat, 26 Apr 2008 09:37:09 -0400> > Hi,> > > On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote:> >> > Are there any examples of how to push out data? As in using input > > and output streams - if I can compare code maybe I can see where > > this is causing a problem. I have a byte array that I am pushing > > out data. I keep getting null pointer exceptions every where I turn.> >> > There are some examples here that might be of help:> > http://rxtx.qbang.org/wiki/index.php/Examples> > Andre _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080426/09f95b41/attachment-0007.html From michael.erskine at ketech.com Mon Apr 28 02:47:22 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 28 Apr 2008 09:47:22 +0100 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D426EF3CBBC5@no-sv-03.ketech.local> Jesrael D. Summerhill wrote: > looked at those....yep didnt help - I need to push out data with GUI and > not get a null pointer exception everytime I try. So it seems pretty obvious that your code needs to check for nulls wherever one may occur and report what's happening. Alternatively, catch the npe and display the stack trace. Then you can fix your code so it doesn't try to work with something that ain't there. Regards, Michael Erskine. From scldad at sdc.com.au Mon Apr 28 03:58:34 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Mon, 28 Apr 2008 19:28:34 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Message-ID: <200804281928.34454.scldad@sdc.com.au> Has anybody done any design work on this? The first thing that springs to mind is that we still need to check for lock files because other apps tend to use that approach even if we go to ioctl. Cheers, Stephen Davies On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > Thanks Trent. > > Problem is only that I'm really not at all > Familiar with the C part of RXTX. If there > Were anything I could do in Java for this, > It would be easier for me.... > > ... Are there any C experts here on the list > Who'd like to look at ioctl port locking > For linux? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > -----Original Message----- > > From: Trent Jarvi [mailto:tjarvi at qbang.org] > > Sent: Donnerstag, 24. April 2008 04:32 > > To: Oberhuber, Martin > > Cc: rxtx at qbang.org > > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > > > I'm wondering what the status is with RXTX locking > > > serial ports on Linux? > > > > > > My understanding is that the mechanism used in > > > 2.1-7r2 (lockfiles) is not really state of the art, and > > > has lots of problems (e.g. missing permissions). > > > > > > There was an idea to migrate towards a Kernel > > > syscall based solution for port locking. > > > > > > What's the status here? > > > > Hi Martin, > > > > I'm in favor of deprecating the current FHS locking mechanism > > in favor of > > an IOCTL when available. I think it will be available on all the > > platforms but do not know for sure. > > > > The status is unchanged. I've had very few free cycles for > > such things. > > Feel free to take a stab at it if you have some time. I > > believe the IOCTL > > is used in the Mac OS X code already. > > > > I don't see any real backwards compatability issues and the > > IOCTL should > > just work. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Mon Apr 28 04:21:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 28 Apr 2008 04:21:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804281928.34454.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: I don't think there would need to be any architectural changes. A couple ifdefs and minor changes in the current code should be enough. Proposal: FHS/UUCP locks: continue to respect them, try to create them but do not error if the IOCTL is supported. (But does the IOCTL being defined mean it will work?) Enumeration: Do not assert the IOCTL while opening. Serial.open: assert the IOCTL after open. Continue to use locks as described above after asserting the IOCTL. If the IOCTL is defined but not working, handle it here. Failure cases include the IOCTL is not supported and the port is already locked. On Mon, 28 Apr 2008, Stephen Davies wrote: > Has anybody done any design work on this? > The first thing that springs to mind is that we still need to check for lock > files because other apps tend to use that approach even if we go to ioctl. > > Cheers, > Stephen Davies > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: >> Thanks Trent. >> >> Problem is only that I'm really not at all >> Familiar with the C part of RXTX. If there >> Were anything I could do in Java for this, >> It would be easier for me.... >> >> ... Are there any C experts here on the list >> Who'd like to look at ioctl port locking >> For linux? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >>> -----Original Message----- >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] >>> Sent: Donnerstag, 24. April 2008 04:32 >>> To: Oberhuber, Martin >>> Cc: rxtx at qbang.org >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? >>> >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: >>>> Dear RXTX community, >>>> >>>> I'm wondering what the status is with RXTX locking >>>> serial ports on Linux? >>>> >>>> My understanding is that the mechanism used in >>>> 2.1-7r2 (lockfiles) is not really state of the art, and >>>> has lots of problems (e.g. missing permissions). >>>> >>>> There was an idea to migrate towards a Kernel >>>> syscall based solution for port locking. >>>> >>>> What's the status here? >>> >>> Hi Martin, >>> >>> I'm in favor of deprecating the current FHS locking mechanism >>> in favor of >>> an IOCTL when available. I think it will be available on all the >>> platforms but do not know for sure. >>> >>> The status is unchanged. I've had very few free cycles for >>> such things. >>> Feel free to take a stab at it if you have some time. I >>> believe the IOCTL >>> is used in the Mac OS X code already. >>> >>> I don't see any real backwards compatability issues and the >>> IOCTL should >>> just work. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Tue Apr 29 12:04:04 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Apr 2008 20:04:04 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Hi all, The biggest problem that I have seen with lockfiles on Linux At least is, that it seems there is no standard with respect To the folder in which they should be created. Also, many Distributions seem to set up file system permissions in such A way that writing to the lockfile folder is not allowed for The normal user -- that's why we stopped using lockfiles In our commercial product. If we are to still respect lockfiles, we first need to Understand where we are expected to look for them. Does Anybody have any insight what variants of lockfile folder Schema exist out there in the wild? Some apps like minicom Seem to even allow users to manually specify a lockfile Folder of their choice. Because of the difficulty finding the right lockfile folder, And because of the inherent risk of thinking that something Might be locked while it actually isn't, I'd suggest that RXTX should have a "soft-off" feature that allows disabling ALL Lockfile checks at runtime without recompiling the native Sharedlibs. Trent - I like your strategy outline, but I think that it Needs to be configurable by the client such that users and/or Customer Support can disable lockfiles / disable ioctl in Case they detect that they are runing on an OS / Kernal that Does not support one or the other. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Montag, 28. April 2008 12:22 > To: Stephen Davies > Cc: rxtx at qbang.org; Oberhuber, Martin; Trent Jarvi > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > I don't think there would need to be any architectural > changes. A couple > ifdefs and minor changes in the current code should be enough. > > Proposal: > > FHS/UUCP locks: > continue to respect them, try to create them but do not error if > the IOCTL is supported. (But does the IOCTL being defined mean > it will work?) > Enumeration: > Do not assert the IOCTL while opening. > Serial.open: > assert the IOCTL after open. Continue to use locks as described > above after asserting the IOCTL. If the IOCTL is defined but > not working, handle it here. Failure cases include the IOCTL > is not supported and the port is already locked. > > On Mon, 28 Apr 2008, Stephen Davies wrote: > > > Has anybody done any design work on this? > > The first thing that springs to mind is that we still need > to check for lock > > files because other apps tend to use that approach even if > we go to ioctl. > > > > Cheers, > > Stephen Davies > > > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > >> Thanks Trent. > >> > >> Problem is only that I'm really not at all > >> Familiar with the C part of RXTX. If there > >> Were anything I could do in Java for this, > >> It would be easier for me.... > >> > >> ... Are there any C experts here on the list > >> Who'd like to look at ioctl port locking > >> For linux? > >> > >> Thanks, > >> -- > >> Martin Oberhuber, Senior Member of Technical Staff, Wind River > >> Target Management Project Lead, DSDP PMC Member > >> http://www.eclipse.org/dsdp/tm > >> > >>> -----Original Message----- > >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] > >>> Sent: Donnerstag, 24. April 2008 04:32 > >>> To: Oberhuber, Martin > >>> Cc: rxtx at qbang.org > >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? > >>> > >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > >>>> Dear RXTX community, > >>>> > >>>> I'm wondering what the status is with RXTX locking > >>>> serial ports on Linux? > >>>> > >>>> My understanding is that the mechanism used in > >>>> 2.1-7r2 (lockfiles) is not really state of the art, and > >>>> has lots of problems (e.g. missing permissions). > >>>> > >>>> There was an idea to migrate towards a Kernel > >>>> syscall based solution for port locking. > >>>> > >>>> What's the status here? > >>> > >>> Hi Martin, > >>> > >>> I'm in favor of deprecating the current FHS locking mechanism > >>> in favor of > >>> an IOCTL when available. I think it will be available on all the > >>> platforms but do not know for sure. > >>> > >>> The status is unchanged. I've had very few free cycles for > >>> such things. > >>> Feel free to take a stab at it if you have some time. I > >>> believe the IOCTL > >>> is used in the Mac OS X code already. > >>> > >>> I don't see any real backwards compatability issues and the > >>> IOCTL should > >>> just work. > >>> > >>> -- > >>> Trent Jarvi > >>> tjarvi at qbang.org > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > From Steffen.DETTMER at ingenico.com Tue Apr 29 13:34:44 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 29 Apr 2008 21:34:44 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Message-ID: <20080429193444.GU2928@elberon.bln.de.ingenico.com> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > The biggest problem that I have seen with lockfiles on Linux > At least is, that it seems there is no standard with respect > To the folder in which they should be created. Also, many > Distributions seem to set up file system permissions in such > A way that writing to the lockfile folder is not allowed for > The normal user -- that's why we stopped using lockfiles > In our commercial product. It seems it depends on the expectations. I consider it as a feature that by default a linux user cannot access serial ports. Maybe root connected a modem (can produce phone bills) or even some serial card reader, maybe with the web servers key pair. I would expect that by default a user cannot open the serial port because of insufficient permissions on the device file. I would expect this on other unices as well (but I don't know it). For windows I think it should be similar but not impacting so much in practice, because often windows users work with big permissions on a somewhat high priviledge level or even Administrator. > If we are to still respect lockfiles, we first need to > Understand where we are expected to look for them. Does > Anybody have any insight what variants of lockfile folder > Schema exist out there in the wild? Some apps like minicom > Seem to even allow users to manually specify a lockfile > Folder of their choice. At least my (ancient) minicom does not allow the user to change this option, it is displayed but read-only, but root is allowed to change it. > Because of the difficulty finding the right lockfile folder, > And because of the inherent risk of thinking that something > Might be locked while it actually isn't, I'd suggest that > RXTX should have a "soft-off" feature that allows disabling > ALL Lockfile checks at runtime without recompiling the native > Sharedlibs. sounds very reasonable, yes... and as admin I would not wish that users could skip such locking because they do things wrong by default ;) (in the end I guess that is related to the dilemma, that hotplug/user-owned-periphery and multi-user systems simply conflict) > Trent - I like your strategy outline, but I think that it > Needs to be configurable by the client such that users and/or > Customer Support can disable lockfiles / disable ioctl in > Case they detect that they are runing on an OS / Kernal that > Does not support one or the other. Yes, this would be good I guess... Applications could offer configuration options to control that, maybe similarily as minicom. BTW, man minicom tells: *B - Lock file location On most systems This should be /usr/spool/uucp. Linux systems use /var/lock. If this directory does not exist, minicom will not attempt to use lockfiles. The statement `Linux systems use /var/lock' is interesting, does anyone know the source of this convention? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Tue Apr 29 16:11:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Apr 2008 16:11:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? These details are outlined in the Filesystem Hierarchy Standard (FHS). http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLOCKLOCKFILES -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Tue Apr 29 18:58:09 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Wed, 30 Apr 2008 10:28:09 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: <200804301028.09307.scldad@sdc.com.au> I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is the same. Any ideas as to how to handle this? Stephen On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: > * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > > The biggest problem that I have seen with lockfiles on Linux > > At least is, that it seems there is no standard with respect > > To the folder in which they should be created. Also, many > > Distributions seem to set up file system permissions in such > > A way that writing to the lockfile folder is not allowed for > > The normal user -- that's why we stopped using lockfiles > > In our commercial product. > > It seems it depends on the expectations. I consider it as a > feature that by default a linux user cannot access serial ports. > Maybe root connected a modem (can produce phone bills) or even > some serial card reader, maybe with the web servers key pair. > > I would expect that by default a user cannot open the serial port > because of insufficient permissions on the device file. I would > expect this on other unices as well (but I don't know it). > > For windows I think it should be similar but not impacting so > much in practice, because often windows users work with big > permissions on a somewhat high priviledge level or even > Administrator. > > > If we are to still respect lockfiles, we first need to > > Understand where we are expected to look for them. Does > > Anybody have any insight what variants of lockfile folder > > Schema exist out there in the wild? Some apps like minicom > > Seem to even allow users to manually specify a lockfile > > Folder of their choice. > > At least my (ancient) minicom does not allow the user to change > this option, it is displayed but read-only, but root is allowed > to change it. > > > Because of the difficulty finding the right lockfile folder, > > And because of the inherent risk of thinking that something > > Might be locked while it actually isn't, I'd suggest that > > RXTX should have a "soft-off" feature that allows disabling > > ALL Lockfile checks at runtime without recompiling the native > > Sharedlibs. > > sounds very reasonable, yes... > and as admin I would not wish that users could skip such > locking because they do things wrong by default ;) > > (in the end I guess that is related to the dilemma, that > hotplug/user-owned-periphery and multi-user systems simply > conflict) > > > Trent - I like your strategy outline, but I think that it > > Needs to be configurable by the client such that users and/or > > Customer Support can disable lockfiles / disable ioctl in > > Case they detect that they are runing on an OS / Kernal that > > Does not support one or the other. > > Yes, this would be good I guess... Applications could offer > configuration options to control that, maybe similarily as > minicom. > > BTW, man minicom tells: > > *B - Lock file location > On most systems This should be /usr/spool/uucp. > Linux systems use /var/lock. If this directory > does not exist, minicom will not attempt to use > lockfiles. > > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure > and expedient electronic transaction acceptance. Ingenico products leverage > proven technology, established standards and unparalleled ergonomics to > provide optimal reliability, versatility and usability. This comprehensive > range of products is complemented by a global array of services and > partnerships, enabling businesses in a number of vertical sectors to accept > transactions anywhere their business takes them. www.ingenico.com This > message may contain confidential and/or privileged information. If you are > not the addressee or authorized to receive this for the addressee, you must > not use, copy, disclose or take any action based on this message or any > information herein. If you have received this message in error, please > advise the sender immediately by reply e-mail and delete this message. > Thank you for your cooperation. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Wed Apr 30 19:30:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 30 Apr 2008 19:30:51 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804301028.09307.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> <200804301028.09307.scldad@sdc.com.au> Message-ID: Hi Stephen, I suspect ioctl/TIOCEXCL open/O_EXCL would do the job. Mac uses TIOCEXCL and it is POSIX. We use O_EXCL for lockfiles on Linux already. On Wed, 30 Apr 2008, Stephen Davies wrote: > I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is > the same. > > Any ideas as to how to handle this? > > Stephen > > > On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: >> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: >>> The biggest problem that I have seen with lockfiles on Linux >>> At least is, that it seems there is no standard with respect >>> To the folder in which they should be created. Also, many >>> Distributions seem to set up file system permissions in such >>> A way that writing to the lockfile folder is not allowed for >>> The normal user -- that's why we stopped using lockfiles >>> In our commercial product. >> >> It seems it depends on the expectations. I consider it as a >> feature that by default a linux user cannot access serial ports. >> Maybe root connected a modem (can produce phone bills) or even >> some serial card reader, maybe with the web servers key pair. >> >> I would expect that by default a user cannot open the serial port >> because of insufficient permissions on the device file. I would >> expect this on other unices as well (but I don't know it). >> >> For windows I think it should be similar but not impacting so >> much in practice, because often windows users work with big >> permissions on a somewhat high priviledge level or even >> Administrator. >> >>> If we are to still respect lockfiles, we first need to >>> Understand where we are expected to look for them. Does >>> Anybody have any insight what variants of lockfile folder >>> Schema exist out there in the wild? Some apps like minicom >>> Seem to even allow users to manually specify a lockfile >>> Folder of their choice. >> >> At least my (ancient) minicom does not allow the user to change >> this option, it is displayed but read-only, but root is allowed >> to change it. >> >>> Because of the difficulty finding the right lockfile folder, >>> And because of the inherent risk of thinking that something >>> Might be locked while it actually isn't, I'd suggest that >>> RXTX should have a "soft-off" feature that allows disabling >>> ALL Lockfile checks at runtime without recompiling the native >>> Sharedlibs. >> >> sounds very reasonable, yes... >> and as admin I would not wish that users could skip such >> locking because they do things wrong by default ;) >> >> (in the end I guess that is related to the dilemma, that >> hotplug/user-owned-periphery and multi-user systems simply >> conflict) >> >>> Trent - I like your strategy outline, but I think that it >>> Needs to be configurable by the client such that users and/or >>> Customer Support can disable lockfiles / disable ioctl in >>> Case they detect that they are runing on an OS / Kernal that >>> Does not support one or the other. >> >> Yes, this would be good I guess... Applications could offer >> configuration options to control that, maybe similarily as >> minicom. >> >> BTW, man minicom tells: >> >> *B - Lock file location >> On most systems This should be /usr/spool/uucp. >> Linux systems use /var/lock. If this directory >> does not exist, minicom will not attempt to use >> lockfiles. >> >> The statement `Linux systems use /var/lock' is interesting, does >> anyone know the source of this convention? >> >> oki, >> >> Steffen >> >> About Ingenico Throughout the world businesses rely on Ingenico for secure >> and expedient electronic transaction acceptance. Ingenico products leverage >> proven technology, established standards and unparalleled ergonomics to >> provide optimal reliability, versatility and usability. This comprehensive >> range of products is complemented by a global array of services and >> partnerships, enabling businesses in a number of vertical sectors to accept >> transactions anywhere their business takes them. www.ingenico.com This >> message may contain confidential and/or privileged information. If you are >> not the addressee or authorized to receive this for the addressee, you must >> not use, copy, disclose or take any action based on this message or any >> information herein. If you have received this message in error, please >> advise the sender immediately by reply e-mail and delete this message. >> Thank you for your cooperation. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0033.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0031.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0018.html From pboulton at pulsetracer.com Fri Apr 18 14:30:13 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Fri, 18 Apr 2008 13:30:13 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site Message-ID: <480904D5.1060307@pulsetracer.com> Hello, gentle serial porters. I have downloaded the zipped up binaries for use on Windows without Sun's CommAPI, but don't seem able to extract anything from the download. Go to main page, http://www.rxtx.org/ Click on Downloads I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) And I save it to disk. If I try and extract the files with WinZip, Winzip thinks the archive is corrupt. If I try using Windows Explorer, I am able to extract it into a single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than the original .zip. Any help would be much appreciated. Sincerely, Philip Boulton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080418/97d89793/attachment-0016.html From tjarvi at qbang.org Fri Apr 18 19:07:00 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 18 Apr 2008 19:07:00 -0600 (MDT) Subject: [Rxtx] Difficulty opening zip file at rxtx site In-Reply-To: <480904D5.1060307@pulsetracer.com> References: <480904D5.1060307@pulsetracer.com> Message-ID: On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org From pboulton at pulsetracer.com Sat Apr 19 12:46:26 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Sat, 19 Apr 2008 11:46:26 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site References: <480904D5.1060307@pulsetracer.com> Message-ID: <53DB7576450695419E09299104043761A78533@ZTGSERVER.ztg.local> I have been able to get my hands on the binaries, by going to the ftp directory /pub/rxtx at ftp.qbang.org,, and ftping the file rxtx-2.1-7-bins-r2.zip . This opens happily with Winzip, and extracts as the set of files that you describe below. I only experience the ill-formed archive problem by clicking the link on the rxtx.org Downloads page (http://rxtx.qbang.org/pub/rxtx/ rxtx-2.1-7-bins-r2.zip ). Not sure what to make of that. Philip Boulton ________________________________ From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Fri 4/18/2008 6:07 PM To: Philip Boulton Cc: rxtx at qbang.org Subject: Re: [Rxtx] Difficulty opening zip file at rxtx site On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080419/147923bb/attachment-0015.html From jlar310 at gmail.com Sat Apr 19 19:11:55 2008 From: jlar310 at gmail.com (Jeff Larsen) Date: Sat, 19 Apr 2008 20:11:55 -0500 Subject: [Rxtx] Moxa serial over Ethernet driver Message-ID: Hi all, I've been using javax.comm for years to communicate with a legacy radio data system. We want to migrate the java side of the system to a VMware Server virtual machine. We've had great success using Moxa DE-303 and 5610 serial over Ethernet appliances and virtual machines for running hylafax. The OS (Linux in this case) uses a kernel driver to communicate with the Moxa via a virtual serial port such as /dev/ttyr00. I want to do the same thing with javax.comm or gnu.io to connect to a virtual serial port. However I'm hitting road blocks everywhere. javax.comm for Linux sees the virtual port, but there are transmission errors. Tried Solaris too, but the Solaris Moxa drivers don't play nice with javax.comm because the driver uses /dev/pts/n instead of /dev/term/x. Next I tried RXTX on Linux, but I'm getting NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX on Solaris. Has anyone used RXTX with serial over Ethernet devices? Any hints on how to make it work? I know that I'm not completely off track because javax.comm does work with Moxa on a Windows platform, but that's just not an option for production deployment. -- Jeff From tjarvi at qbang.org Sat Apr 19 21:08:41 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 19 Apr 2008 21:08:41 -0600 (MDT) Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: yOn Sat, 19 Apr 2008, Jeff Larsen wrote: > Hi all, > > I've been using javax.comm for years to communicate with a legacy > radio data system. We want to migrate the java side of the system to a > VMware Server virtual machine. We've had great success using Moxa > DE-303 and 5610 serial over Ethernet appliances and virtual machines > for running hylafax. The OS (Linux in this case) uses a kernel driver > to communicate with the Moxa via a virtual serial port such as > /dev/ttyr00. > > I want to do the same thing with javax.comm or gnu.io to connect to a > virtual serial port. However I'm hitting road blocks everywhere. > javax.comm for Linux sees the virtual port, but there are transmission > errors. Tried Solaris too, but the Solaris Moxa drivers don't play > nice with javax.comm because the driver uses /dev/pts/n instead of > /dev/term/x. Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris. > > Has anyone used RXTX with serial over Ethernet devices? Any hints on > how to make it work? > > I know that I'm not completely off track because javax.comm does work > with Moxa on a Windows platform, but that's just not an option for > production deployment. > > Moxa should work under linux. There may be minor issues depending upon how complete the kernel driver is but I think it will work. One of the minor issues is /dev/ttyr00 is not enumerated. There are several work arounds documented with the source code and on the wiki. The easiest solution for testing purposes is to make a symbolic link from /dev/ttyr00 to a port that is enumerated such as /dev/ttyS129. You can later alter the rxtx source or use properties to change the enumerated ports. -- Trent Jarvi tjarvi at qbang.org From d.tonhofer at m-plify.com Sun Apr 20 03:33:30 2008 From: d.tonhofer at m-plify.com (David Tonhofer (M-PLIFY S.A.)) Date: Sun, 20 Apr 2008 11:33:30 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: <480B0DEA.5010908@m-plify.com> Jeff Larsen wrote: > Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris It might be that the Java side of RXTX does not recognize that portname. Trying modifying src/RXTXCommDriver.java as described in this case: http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card From ajmas at sympatico.ca Sun Apr 20 16:37:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Apr 2008 18:37:59 -0400 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <480B0DEA.5010908@m-plify.com> References: <480B0DEA.5010908@m-plify.com> Message-ID: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > Jeff Larsen wrote: >> Next I tried RXTX on Linux, but I'm getting >> NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX >> on Solaris > It might be that the Java side of RXTX does not recognize that > portname. > Trying modifying src/RXTXCommDriver.java as described in this case: > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card I wonder whether it would be worth allowing custom port prefixes as a system parameter? For example: gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" Andre From Martin.Oberhuber at windriver.com Tue Apr 22 12:34:36 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 22 Apr 2008 20:34:36 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> References: <480B0DEA.5010908@m-plify.com> <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE6485848056CD6CE@ism-mail03.corp.ad.wrs.com> Sounds like a great idea... I'm wondering how the "variable part" after the Prefixes could be specified though? What about allowing Regular Expression character Classes in the existing System Property for specifying ports: System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyS[0-9],ttyS[ABC],ttyUSB[0-9a-z]"); The set of allowed patterns would of course need to Be restricted compared to REGEX, because it must be A syntax that supports iterating over it. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Montag, 21. April 2008 00:38 > To: rxtx at qbang.org and Users > Subject: Re: [Rxtx] Moxa serial over Ethernet driver > > > On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > > Jeff Larsen wrote: > >> Next I tried RXTX on Linux, but I'm getting > >> NoSuchPortException connecting to /dev/ttyr00. I have yet > to try RXTX > >> on Solaris > > It might be that the Java side of RXTX does not recognize that > > portname. > > Trying modifying src/RXTXCommDriver.java as described in this case: > > > > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_ > SST-4P.2FLP_multiport_card > > I wonder whether it would be worth allowing custom port > prefixes as a > system parameter? For > example: > > gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Loi.TRAN at weatherford.com Tue Apr 22 13:10:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Tue, 22 Apr 2008 14:10:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled Message-ID: Hi, I'm currently using the Java RXTX API to interface to a serial port. The serial port is connected to a bridge board that communicates with our communications system running at 1.875 Mbps which is linked to an embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no flow control). I send a command to the embedded board through the serial-bridge board which then is relayed to the embedded board. The command sent asks the embedded board to dump a binary image. Here's where I'm hitting some problems. I've successfully done this is an integrated serial port from the laptop. The binary file that comes back is consistent on every attempt. When I use the application I've written to do the same thing with a USB-to-serial adapter, the image I get back is not the same as the image I receive through the USB-to-serial adapter is not consistent at all. A final thing is that when I use a terminal program to dump the binary image with the USB-serial adapter, the image is correct. Every time! What is the terminal program doing that's not being done in my application? My application is quite simple. Has anyone observed this behavior before? If you have, I'd like to know how you've gotten around this problem. Thanks, LT =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From tjarvi at qbang.org Tue Apr 22 21:11:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 22 Apr 2008 21:11:10 -0600 (MDT) Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org From Loi.TRAN at weatherford.com Wed Apr 23 08:35:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Wed, 23 Apr 2008 09:35:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: Thanks for all the responses. I finally tried something that worked consistently. I updated my Prolific driver and repeated my tests. It worked. If you're using the Prolific type USB-serial adapters, do no use the Prolific version 2.0.2.1 driver on Windows. Update it to the latest 2.0.2.8 version. Again, thanks for all the responses. LT -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Tuesday, April 22, 2008 10:11 PM To: TRAN, Loi X. Cc: rxtx at qbang.org Subject: Re: [Rxtx] Prolific USB - RXTX data mangled On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From Martin.Oberhuber at windriver.com Wed Apr 23 18:54:26 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 02:54:26 +0200 Subject: [Rxtx] RXTX port locking on Linux status? Message-ID: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Dear RXTX community, I'm wondering what the status is with RXTX locking serial ports on Linux? My understanding is that the mechanism used in 2.1-7r2 (lockfiles) is not really state of the art, and has lots of problems (e.g. missing permissions). There was an idea to migrate towards a Kernel syscall based solution for port locking. What's the status here? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/9878db9f/attachment-0011.html From tjarvi at qbang.org Wed Apr 23 20:32:24 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Apr 2008 20:32:24 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > Dear RXTX community, > > I'm wondering what the status is with RXTX locking > serial ports on Linux? > > My understanding is that the mechanism used in > 2.1-7r2 (lockfiles) is not really state of the art, and > has lots of problems (e.g. missing permissions). > > There was an idea to migrate towards a Kernel > syscall based solution for port locking. > > What's the status here? > Hi Martin, I'm in favor of deprecating the current FHS locking mechanism in favor of an IOCTL when available. I think it will be available on all the platforms but do not know for sure. The status is unchanged. I've had very few free cycles for such things. Feel free to take a stab at it if you have some time. I believe the IOCTL is used in the Mac OS X code already. I don't see any real backwards compatability issues and the IOCTL should just work. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Apr 24 06:14:06 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 14:14:06 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Thanks Trent. Problem is only that I'm really not at all Familiar with the C part of RXTX. If there Were anything I could do in Java for this, It would be easier for me.... ... Are there any C experts here on the list Who'd like to look at ioctl port locking For linux? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Donnerstag, 24. April 2008 04:32 > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > I'm wondering what the status is with RXTX locking > > serial ports on Linux? > > > > My understanding is that the mechanism used in > > 2.1-7r2 (lockfiles) is not really state of the art, and > > has lots of problems (e.g. missing permissions). > > > > There was an idea to migrate towards a Kernel > > syscall based solution for port locking. > > > > What's the status here? > > > > Hi Martin, > > I'm in favor of deprecating the current FHS locking mechanism > in favor of > an IOCTL when available. I think it will be available on all the > platforms but do not know for sure. > > The status is unchanged. I've had very few free cycles for > such things. > Feel free to take a stab at it if you have some time. I > believe the IOCTL > is used in the Mac OS X code already. > > I don't see any real backwards compatability issues and the > IOCTL should > just work. > > -- > Trent Jarvi > tjarvi at qbang.org > From sspies at sloc.de Thu Apr 24 07:15:36 2008 From: sspies at sloc.de (Sebastian Spies) Date: Thu, 24 Apr 2008 15:15:36 +0200 (CEST) Subject: [Rxtx] rxtx on gumstix: Interrupted system call In-Reply-To: <47FB7B20.7080504@sloc.de> References: <47FB7B20.7080504@sloc.de> Message-ID: <55445.130.83.139.205.1209042936.squirrel@ssl.sloc.de> Dear list, while porting rxtx to the gumstix, I found out, that select used in readArray in SerialImp.c might not work as expected. Maybe, because of missing TIOCSERGETLSR-support? select is often interrupted, so i wrote the following quick'n'dirty hack to make it work on gumstix: diff -Nur rxtx-2.1-7r2/src/SerialImp.c rxtx-2.1-7r2/src/SerialImp.c --- rxtx-2.1-7r2/src/SerialImp.c 2006-01-29 23:19:04.000000000 +0100 +++ rxtx-2.1-7r2-patched/src/SerialImp.c 2008-04-24 14:30:17.000000000 +0200 @@ -3380,7 +3381,7 @@ JNIEXPORT jint JNICALL RXTXPort(readArray)( JNIEnv *env, jobject jobj, jbyteArray jbarray, jint offset, jint length ) { - int bytes; + int bytes = 0; jbyte *body; /* char msg[80]; */ int fd = get_java_var( env, jobj, "fd", "I" ); @@ -3397,9 +3398,18 @@ "readArray", "Invalid length" ); return -1; } - body = (*env)->GetByteArrayElements( env, jbarray, 0 ); - bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ - (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + while(1 > bytes) + { + body = (*env)->GetByteArrayElements( env, jbarray, 0 ); + bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ + (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + // quick'n'dirty - SSP + report (" trying again... \n"); + errno = 0; + } + if( bytes < 0 ) { report( "RXTXPort:readArray bytes < 0" ); LEAVE( "RXTXPort:readArray" ); > Hey, > > I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use > RXTXPort$SerialInputStream.read(), then I get the following Exception. I > did not yet figure out which system call is interrupted as strace > produces loads of output. > > Any help would be very appreciated. Thanks in advance. > Sebastian > > > [java] java.io.IOException: Interrupted system call in readArray > [java] at gnu.io.RXTXPort.readArray(Native Method) > [java] at > gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) > [java] at > java.io.FilterInputStream.read(FilterInputStream.java:189) > [java] at > java.io.BufferedInputStream.refill(BufferedInputStream.java:371) > [java] at > java.io.BufferedInputStream.read(BufferedInputStream.java:229) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) > [java] at > com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) > > -- > Sebastian Spies > > mail: sspies at sloc.de > > > > From fire_baptized at hotmail.com Thu Apr 24 18:27:48 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Thu, 24 Apr 2008 20:27:48 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hello I am having a problem with the serial device connecting (software wise) to the serial port. However I have a test program and it seems to work just fine in that environment - and it doesnt use GUI. The error I am getting is : PortNotFoundException Now the way I have it setup in the GUI environment is that once the user pushes a JButton the program connects using this class: protected void establishConnection() { try { portId = CommPortIdentifier.getPortIdentifier("COM3"); System.out.println("Establishing connction....."); messages[0] = "\nEstablishing connction.....\n"; } catch ( NoSuchPortException noport) { System.out.println("Port not found: "+ noport); messages[0] = "Port not found: "+ noport+"\n"; } try { serialPort = (SerialPort) portId.open("serial", 50); System.out.println("Port has been found."); messages[1] = "Port has been found.\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[1] = "" +usedport; } try { serialPort = (SerialPort) portId.open("serial", 50); messages[2] = "Connecting to COM3 on port 50....\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; } try { serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); System.out.println("Esablishing the transfer rate settings for COM3."); messages[3] = "Esablishing the transfer rate settings for COM3.\n"; } catch (UnsupportedCommOperationException nosupcom) { System.out.println(nosupcom); System.out.println("The tranfer rate could not be esblished on COM3."); messages[3] = "The tranfer rate could not be esblished on COM3.\n"; } System.out.println(serialPort.getFlowControlMode()); messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; //sendDataOut(buffer[3],buffer[4]); } I need all the data in this method (and all the string values in this method) to be printed out on a JTextArea. I wont do me any good if not all the text is printed on a JTextArea in another class. So I have the text printing the JTextArea correctly, but everytime the JButton is activated - it gives me that error message. I did add a disconnect button that is supposed to call the serialPort.close(). _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/273fd4ec/attachment-0010.html From tjarvi at qbang.org Thu Apr 24 21:54:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Apr 2008 21:54:10 -0600 (MDT) Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > Hello I am having a problem with the serial device connecting (software > wise) to the serial port. However I have a test program and it seems to > work just fine in that environment - and it doesnt use GUI. The error I > am getting is : PortNotFoundException Now the way I have it setup in the > GUI environment is that once the user pushes a JButton the program > connects using this class: > > protected void establishConnection() { > try { > portId = CommPortIdentifier.getPortIdentifier("COM3"); > System.out.println("Establishing connction....."); > messages[0] = "\nEstablishing connction.....\n"; > } > catch ( NoSuchPortException noport) { > System.out.println("Port not found: "+ noport); > messages[0] = "Port not found: "+ noport+"\n"; > } > try { > serialPort = (SerialPort) portId.open("serial", 50); > System.out.println("Port has been found."); > messages[1] = "Port has been found.\n"; > } > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[1] = "" +usedport; > } ================================================================= > try { > serialPort = (SerialPort) portId.open("serial", 50); > messages[2] = "Connecting to COM3 on port 50....\n"; > } ================================================================== > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > } > try { > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > System.out.println("Esablishing the transfer rate settings for COM3."); > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > } > catch (UnsupportedCommOperationException nosupcom) { > System.out.println(nosupcom); > System.out.println("The tranfer rate could not be esblished on COM3."); > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > } > System.out.println(serialPort.getFlowControlMode()); > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > //sendDataOut(buffer[3],buffer[4]); > } > > I need all the data in this method (and all the string values in this > method) to be printed out on a JTextArea. I wont do me any good if not > all the text is printed on a JTextArea in another class. So I have the > text printing the JTextArea correctly, but everytime the JButton is > activated - it gives me that error message. I did add a disconnect > button that is supposed to call the serialPort.close(). > The open code used twice is going to throw an exception. It may be that you catch the exception above this code and print a confusing message? A common mistake is people will accidently run two copies of their program. The first instance of the program will open the port and prevent enumeration (finding the port) in the second instance of the program. As an example, you may be running your text based application which is preventing the GUI from seeing the port. Enumeration is done by trying to open the port. If the port is open, Enumeration fails. -- Trent Jarvi tjarvi at qbang.org From fire_baptized at hotmail.com Thu Apr 24 22:32:05 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 00:32:05 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Wow - thanks dude what a dumb thing for me to not catch..... now here is the current problem - right now I am trying to output data again one is with the test program - and it seems that serialPort.setRTS(true); is throwing an exceptions there - now if I show this code please bare in mind that I am only testing - the code is kinda sloppy in my mind - but if I can figure out why calling this function is throwing an exception then maybe I can figure out why my GUI application is getting the same null pointer exceptions when try to send out the data stream. FYI Trent this email is not directed towards you - anyone can jump in on this public static void main(String args[]) { byte[] b = new byte[64]; int keyinput = 0 ; byte x = 0; byte y = 0; PortTesting1 testports = new PortTesting1(); try { joyskoro = Joystick.createInstance(); } catch (IOException ioexc) { System.out.println("There is an input/output problem: " + ioexc); } while (true) { joyskoro.poll(); b[0] = ((byte) -(10 * joyskoro.getY())); b[1] = ((byte) (10 * joyskoro.getX())); System.out.println("The 3rd byte is: " +b[0]); System.out.println("The 4rd byte is: " +b[1]); serialPort.setRTS(true); // HERE IS WHERE THE PROBLEM IS !!!!!!! ON THIS LINE but if I dont have it active in my program the Bluetooth device (that is System.out.println("Ready to send :-) !"); //connected to the serial port does not send out data!!!!! if (joyskoro.isButtonDown(joyskoro.BUTTON10)) { System.out.println("Connection terminated."); serialPort.close(); break; } if (joyskoro.isButtonDown(joyskoro.BUTTON2)) { boolean flag = true; //reading from key input from the keyboard System.out.println("Please input a command: "); while (flag) { try { keyinput = System.in.read(); } catch (IOException ioexc) {/*there is no need to put * anything here */ } if((char)keyinput=='w') { pushIt((byte)85); } if((char)keyinput=='s') { pushIt((byte)84); } if((char)keyinput=='a') { pushIt((byte)83); } if((char)keyinput=='d') { pushIt((byte)82); } if((char)keyinput=='q') { pushIt((byte)89); } if((char)keyinput=='\t') { //this stop reading input from the keyboard flag = false; } } and help anyways here is the block of code that throwing an exception for the test program: > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/5c8f7d68/attachment-0010.html From fire_baptized at hotmail.com Fri Apr 25 07:59:53 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 09:59:53 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Are there any examples of how to push out data? As in using input and output streams - if I can compare code maybe I can see where this is causing a problem. I have a byte array that I am pushing out data. I keep getting null pointer exceptions every where I turn. > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/22228ab6/attachment-0009.html From ajmas at sympatico.ca Sat Apr 26 07:37:09 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 26 Apr 2008 09:37:09 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hi, On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote: > > Are there any examples of how to push out data? As in using input > and output streams - if I can compare code maybe I can see where > this is causing a problem. I have a byte array that I am pushing > out data. I keep getting null pointer exceptions every where I turn. > There are some examples here that might be of help: http://rxtx.qbang.org/wiki/index.php/Examples Andre From fire_baptized at hotmail.com Sat Apr 26 20:13:54 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Sat, 26 Apr 2008 22:13:54 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: looked at those....yep didnt help - I need to push out data with GUI and not get a null pointer exception everytime I try. > CC: rxtx at qbang.org> From: ajmas at sympatico.ca> To: fire_baptized at hotmail.com> Subject: Re: [Rxtx] Serial Problems with Gui.....> Date: Sat, 26 Apr 2008 09:37:09 -0400> > Hi,> > > On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote:> >> > Are there any examples of how to push out data? As in using input > > and output streams - if I can compare code maybe I can see where > > this is causing a problem. I have a byte array that I am pushing > > out data. I keep getting null pointer exceptions every where I turn.> >> > There are some examples here that might be of help:> > http://rxtx.qbang.org/wiki/index.php/Examples> > Andre _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080426/09f95b41/attachment-0008.html From michael.erskine at ketech.com Mon Apr 28 02:47:22 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 28 Apr 2008 09:47:22 +0100 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D426EF3CBBC5@no-sv-03.ketech.local> Jesrael D. Summerhill wrote: > looked at those....yep didnt help - I need to push out data with GUI and > not get a null pointer exception everytime I try. So it seems pretty obvious that your code needs to check for nulls wherever one may occur and report what's happening. Alternatively, catch the npe and display the stack trace. Then you can fix your code so it doesn't try to work with something that ain't there. Regards, Michael Erskine. From scldad at sdc.com.au Mon Apr 28 03:58:34 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Mon, 28 Apr 2008 19:28:34 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Message-ID: <200804281928.34454.scldad@sdc.com.au> Has anybody done any design work on this? The first thing that springs to mind is that we still need to check for lock files because other apps tend to use that approach even if we go to ioctl. Cheers, Stephen Davies On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > Thanks Trent. > > Problem is only that I'm really not at all > Familiar with the C part of RXTX. If there > Were anything I could do in Java for this, > It would be easier for me.... > > ... Are there any C experts here on the list > Who'd like to look at ioctl port locking > For linux? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > -----Original Message----- > > From: Trent Jarvi [mailto:tjarvi at qbang.org] > > Sent: Donnerstag, 24. April 2008 04:32 > > To: Oberhuber, Martin > > Cc: rxtx at qbang.org > > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > > > I'm wondering what the status is with RXTX locking > > > serial ports on Linux? > > > > > > My understanding is that the mechanism used in > > > 2.1-7r2 (lockfiles) is not really state of the art, and > > > has lots of problems (e.g. missing permissions). > > > > > > There was an idea to migrate towards a Kernel > > > syscall based solution for port locking. > > > > > > What's the status here? > > > > Hi Martin, > > > > I'm in favor of deprecating the current FHS locking mechanism > > in favor of > > an IOCTL when available. I think it will be available on all the > > platforms but do not know for sure. > > > > The status is unchanged. I've had very few free cycles for > > such things. > > Feel free to take a stab at it if you have some time. I > > believe the IOCTL > > is used in the Mac OS X code already. > > > > I don't see any real backwards compatability issues and the > > IOCTL should > > just work. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Mon Apr 28 04:21:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 28 Apr 2008 04:21:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804281928.34454.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: I don't think there would need to be any architectural changes. A couple ifdefs and minor changes in the current code should be enough. Proposal: FHS/UUCP locks: continue to respect them, try to create them but do not error if the IOCTL is supported. (But does the IOCTL being defined mean it will work?) Enumeration: Do not assert the IOCTL while opening. Serial.open: assert the IOCTL after open. Continue to use locks as described above after asserting the IOCTL. If the IOCTL is defined but not working, handle it here. Failure cases include the IOCTL is not supported and the port is already locked. On Mon, 28 Apr 2008, Stephen Davies wrote: > Has anybody done any design work on this? > The first thing that springs to mind is that we still need to check for lock > files because other apps tend to use that approach even if we go to ioctl. > > Cheers, > Stephen Davies > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: >> Thanks Trent. >> >> Problem is only that I'm really not at all >> Familiar with the C part of RXTX. If there >> Were anything I could do in Java for this, >> It would be easier for me.... >> >> ... Are there any C experts here on the list >> Who'd like to look at ioctl port locking >> For linux? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >>> -----Original Message----- >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] >>> Sent: Donnerstag, 24. April 2008 04:32 >>> To: Oberhuber, Martin >>> Cc: rxtx at qbang.org >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? >>> >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: >>>> Dear RXTX community, >>>> >>>> I'm wondering what the status is with RXTX locking >>>> serial ports on Linux? >>>> >>>> My understanding is that the mechanism used in >>>> 2.1-7r2 (lockfiles) is not really state of the art, and >>>> has lots of problems (e.g. missing permissions). >>>> >>>> There was an idea to migrate towards a Kernel >>>> syscall based solution for port locking. >>>> >>>> What's the status here? >>> >>> Hi Martin, >>> >>> I'm in favor of deprecating the current FHS locking mechanism >>> in favor of >>> an IOCTL when available. I think it will be available on all the >>> platforms but do not know for sure. >>> >>> The status is unchanged. I've had very few free cycles for >>> such things. >>> Feel free to take a stab at it if you have some time. I >>> believe the IOCTL >>> is used in the Mac OS X code already. >>> >>> I don't see any real backwards compatability issues and the >>> IOCTL should >>> just work. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Tue Apr 29 12:04:04 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Apr 2008 20:04:04 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Hi all, The biggest problem that I have seen with lockfiles on Linux At least is, that it seems there is no standard with respect To the folder in which they should be created. Also, many Distributions seem to set up file system permissions in such A way that writing to the lockfile folder is not allowed for The normal user -- that's why we stopped using lockfiles In our commercial product. If we are to still respect lockfiles, we first need to Understand where we are expected to look for them. Does Anybody have any insight what variants of lockfile folder Schema exist out there in the wild? Some apps like minicom Seem to even allow users to manually specify a lockfile Folder of their choice. Because of the difficulty finding the right lockfile folder, And because of the inherent risk of thinking that something Might be locked while it actually isn't, I'd suggest that RXTX should have a "soft-off" feature that allows disabling ALL Lockfile checks at runtime without recompiling the native Sharedlibs. Trent - I like your strategy outline, but I think that it Needs to be configurable by the client such that users and/or Customer Support can disable lockfiles / disable ioctl in Case they detect that they are runing on an OS / Kernal that Does not support one or the other. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Montag, 28. April 2008 12:22 > To: Stephen Davies > Cc: rxtx at qbang.org; Oberhuber, Martin; Trent Jarvi > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > I don't think there would need to be any architectural > changes. A couple > ifdefs and minor changes in the current code should be enough. > > Proposal: > > FHS/UUCP locks: > continue to respect them, try to create them but do not error if > the IOCTL is supported. (But does the IOCTL being defined mean > it will work?) > Enumeration: > Do not assert the IOCTL while opening. > Serial.open: > assert the IOCTL after open. Continue to use locks as described > above after asserting the IOCTL. If the IOCTL is defined but > not working, handle it here. Failure cases include the IOCTL > is not supported and the port is already locked. > > On Mon, 28 Apr 2008, Stephen Davies wrote: > > > Has anybody done any design work on this? > > The first thing that springs to mind is that we still need > to check for lock > > files because other apps tend to use that approach even if > we go to ioctl. > > > > Cheers, > > Stephen Davies > > > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > >> Thanks Trent. > >> > >> Problem is only that I'm really not at all > >> Familiar with the C part of RXTX. If there > >> Were anything I could do in Java for this, > >> It would be easier for me.... > >> > >> ... Are there any C experts here on the list > >> Who'd like to look at ioctl port locking > >> For linux? > >> > >> Thanks, > >> -- > >> Martin Oberhuber, Senior Member of Technical Staff, Wind River > >> Target Management Project Lead, DSDP PMC Member > >> http://www.eclipse.org/dsdp/tm > >> > >>> -----Original Message----- > >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] > >>> Sent: Donnerstag, 24. April 2008 04:32 > >>> To: Oberhuber, Martin > >>> Cc: rxtx at qbang.org > >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? > >>> > >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > >>>> Dear RXTX community, > >>>> > >>>> I'm wondering what the status is with RXTX locking > >>>> serial ports on Linux? > >>>> > >>>> My understanding is that the mechanism used in > >>>> 2.1-7r2 (lockfiles) is not really state of the art, and > >>>> has lots of problems (e.g. missing permissions). > >>>> > >>>> There was an idea to migrate towards a Kernel > >>>> syscall based solution for port locking. > >>>> > >>>> What's the status here? > >>> > >>> Hi Martin, > >>> > >>> I'm in favor of deprecating the current FHS locking mechanism > >>> in favor of > >>> an IOCTL when available. I think it will be available on all the > >>> platforms but do not know for sure. > >>> > >>> The status is unchanged. I've had very few free cycles for > >>> such things. > >>> Feel free to take a stab at it if you have some time. I > >>> believe the IOCTL > >>> is used in the Mac OS X code already. > >>> > >>> I don't see any real backwards compatability issues and the > >>> IOCTL should > >>> just work. > >>> > >>> -- > >>> Trent Jarvi > >>> tjarvi at qbang.org > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > From Steffen.DETTMER at ingenico.com Tue Apr 29 13:34:44 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 29 Apr 2008 21:34:44 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Message-ID: <20080429193444.GU2928@elberon.bln.de.ingenico.com> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > The biggest problem that I have seen with lockfiles on Linux > At least is, that it seems there is no standard with respect > To the folder in which they should be created. Also, many > Distributions seem to set up file system permissions in such > A way that writing to the lockfile folder is not allowed for > The normal user -- that's why we stopped using lockfiles > In our commercial product. It seems it depends on the expectations. I consider it as a feature that by default a linux user cannot access serial ports. Maybe root connected a modem (can produce phone bills) or even some serial card reader, maybe with the web servers key pair. I would expect that by default a user cannot open the serial port because of insufficient permissions on the device file. I would expect this on other unices as well (but I don't know it). For windows I think it should be similar but not impacting so much in practice, because often windows users work with big permissions on a somewhat high priviledge level or even Administrator. > If we are to still respect lockfiles, we first need to > Understand where we are expected to look for them. Does > Anybody have any insight what variants of lockfile folder > Schema exist out there in the wild? Some apps like minicom > Seem to even allow users to manually specify a lockfile > Folder of their choice. At least my (ancient) minicom does not allow the user to change this option, it is displayed but read-only, but root is allowed to change it. > Because of the difficulty finding the right lockfile folder, > And because of the inherent risk of thinking that something > Might be locked while it actually isn't, I'd suggest that > RXTX should have a "soft-off" feature that allows disabling > ALL Lockfile checks at runtime without recompiling the native > Sharedlibs. sounds very reasonable, yes... and as admin I would not wish that users could skip such locking because they do things wrong by default ;) (in the end I guess that is related to the dilemma, that hotplug/user-owned-periphery and multi-user systems simply conflict) > Trent - I like your strategy outline, but I think that it > Needs to be configurable by the client such that users and/or > Customer Support can disable lockfiles / disable ioctl in > Case they detect that they are runing on an OS / Kernal that > Does not support one or the other. Yes, this would be good I guess... Applications could offer configuration options to control that, maybe similarily as minicom. BTW, man minicom tells: *B - Lock file location On most systems This should be /usr/spool/uucp. Linux systems use /var/lock. If this directory does not exist, minicom will not attempt to use lockfiles. The statement `Linux systems use /var/lock' is interesting, does anyone know the source of this convention? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Tue Apr 29 16:11:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Apr 2008 16:11:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? These details are outlined in the Filesystem Hierarchy Standard (FHS). http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLOCKLOCKFILES -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Tue Apr 29 18:58:09 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Wed, 30 Apr 2008 10:28:09 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: <200804301028.09307.scldad@sdc.com.au> I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is the same. Any ideas as to how to handle this? Stephen On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: > * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > > The biggest problem that I have seen with lockfiles on Linux > > At least is, that it seems there is no standard with respect > > To the folder in which they should be created. Also, many > > Distributions seem to set up file system permissions in such > > A way that writing to the lockfile folder is not allowed for > > The normal user -- that's why we stopped using lockfiles > > In our commercial product. > > It seems it depends on the expectations. I consider it as a > feature that by default a linux user cannot access serial ports. > Maybe root connected a modem (can produce phone bills) or even > some serial card reader, maybe with the web servers key pair. > > I would expect that by default a user cannot open the serial port > because of insufficient permissions on the device file. I would > expect this on other unices as well (but I don't know it). > > For windows I think it should be similar but not impacting so > much in practice, because often windows users work with big > permissions on a somewhat high priviledge level or even > Administrator. > > > If we are to still respect lockfiles, we first need to > > Understand where we are expected to look for them. Does > > Anybody have any insight what variants of lockfile folder > > Schema exist out there in the wild? Some apps like minicom > > Seem to even allow users to manually specify a lockfile > > Folder of their choice. > > At least my (ancient) minicom does not allow the user to change > this option, it is displayed but read-only, but root is allowed > to change it. > > > Because of the difficulty finding the right lockfile folder, > > And because of the inherent risk of thinking that something > > Might be locked while it actually isn't, I'd suggest that > > RXTX should have a "soft-off" feature that allows disabling > > ALL Lockfile checks at runtime without recompiling the native > > Sharedlibs. > > sounds very reasonable, yes... > and as admin I would not wish that users could skip such > locking because they do things wrong by default ;) > > (in the end I guess that is related to the dilemma, that > hotplug/user-owned-periphery and multi-user systems simply > conflict) > > > Trent - I like your strategy outline, but I think that it > > Needs to be configurable by the client such that users and/or > > Customer Support can disable lockfiles / disable ioctl in > > Case they detect that they are runing on an OS / Kernal that > > Does not support one or the other. > > Yes, this would be good I guess... Applications could offer > configuration options to control that, maybe similarily as > minicom. > > BTW, man minicom tells: > > *B - Lock file location > On most systems This should be /usr/spool/uucp. > Linux systems use /var/lock. If this directory > does not exist, minicom will not attempt to use > lockfiles. > > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure > and expedient electronic transaction acceptance. Ingenico products leverage > proven technology, established standards and unparalleled ergonomics to > provide optimal reliability, versatility and usability. This comprehensive > range of products is complemented by a global array of services and > partnerships, enabling businesses in a number of vertical sectors to accept > transactions anywhere their business takes them. www.ingenico.com This > message may contain confidential and/or privileged information. If you are > not the addressee or authorized to receive this for the addressee, you must > not use, copy, disclose or take any action based on this message or any > information herein. If you have received this message in error, please > advise the sender immediately by reply e-mail and delete this message. > Thank you for your cooperation. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Wed Apr 30 19:30:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 30 Apr 2008 19:30:51 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804301028.09307.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> <200804301028.09307.scldad@sdc.com.au> Message-ID: Hi Stephen, I suspect ioctl/TIOCEXCL open/O_EXCL would do the job. Mac uses TIOCEXCL and it is POSIX. We use O_EXCL for lockfiles on Linux already. On Wed, 30 Apr 2008, Stephen Davies wrote: > I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is > the same. > > Any ideas as to how to handle this? > > Stephen > > > On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: >> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: >>> The biggest problem that I have seen with lockfiles on Linux >>> At least is, that it seems there is no standard with respect >>> To the folder in which they should be created. Also, many >>> Distributions seem to set up file system permissions in such >>> A way that writing to the lockfile folder is not allowed for >>> The normal user -- that's why we stopped using lockfiles >>> In our commercial product. >> >> It seems it depends on the expectations. I consider it as a >> feature that by default a linux user cannot access serial ports. >> Maybe root connected a modem (can produce phone bills) or even >> some serial card reader, maybe with the web servers key pair. >> >> I would expect that by default a user cannot open the serial port >> because of insufficient permissions on the device file. I would >> expect this on other unices as well (but I don't know it). >> >> For windows I think it should be similar but not impacting so >> much in practice, because often windows users work with big >> permissions on a somewhat high priviledge level or even >> Administrator. >> >>> If we are to still respect lockfiles, we first need to >>> Understand where we are expected to look for them. Does >>> Anybody have any insight what variants of lockfile folder >>> Schema exist out there in the wild? Some apps like minicom >>> Seem to even allow users to manually specify a lockfile >>> Folder of their choice. >> >> At least my (ancient) minicom does not allow the user to change >> this option, it is displayed but read-only, but root is allowed >> to change it. >> >>> Because of the difficulty finding the right lockfile folder, >>> And because of the inherent risk of thinking that something >>> Might be locked while it actually isn't, I'd suggest that >>> RXTX should have a "soft-off" feature that allows disabling >>> ALL Lockfile checks at runtime without recompiling the native >>> Sharedlibs. >> >> sounds very reasonable, yes... >> and as admin I would not wish that users could skip such >> locking because they do things wrong by default ;) >> >> (in the end I guess that is related to the dilemma, that >> hotplug/user-owned-periphery and multi-user systems simply >> conflict) >> >>> Trent - I like your strategy outline, but I think that it >>> Needs to be configurable by the client such that users and/or >>> Customer Support can disable lockfiles / disable ioctl in >>> Case they detect that they are runing on an OS / Kernal that >>> Does not support one or the other. >> >> Yes, this would be good I guess... Applications could offer >> configuration options to control that, maybe similarily as >> minicom. >> >> BTW, man minicom tells: >> >> *B - Lock file location >> On most systems This should be /usr/spool/uucp. >> Linux systems use /var/lock. If this directory >> does not exist, minicom will not attempt to use >> lockfiles. >> >> The statement `Linux systems use /var/lock' is interesting, does >> anyone know the source of this convention? >> >> oki, >> >> Steffen >> >> About Ingenico Throughout the world businesses rely on Ingenico for secure >> and expedient electronic transaction acceptance. Ingenico products leverage >> proven technology, established standards and unparalleled ergonomics to >> provide optimal reliability, versatility and usability. This comprehensive >> range of products is complemented by a global array of services and >> partnerships, enabling businesses in a number of vertical sectors to accept >> transactions anywhere their business takes them. www.ingenico.com This >> message may contain confidential and/or privileged information. If you are >> not the addressee or authorized to receive this for the addressee, you must >> not use, copy, disclose or take any action based on this message or any >> information herein. If you have received this message in error, please >> advise the sender immediately by reply e-mail and delete this message. >> Thank you for your cooperation. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0034.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0032.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0019.html From pboulton at pulsetracer.com Fri Apr 18 14:30:13 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Fri, 18 Apr 2008 13:30:13 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site Message-ID: <480904D5.1060307@pulsetracer.com> Hello, gentle serial porters. I have downloaded the zipped up binaries for use on Windows without Sun's CommAPI, but don't seem able to extract anything from the download. Go to main page, http://www.rxtx.org/ Click on Downloads I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) And I save it to disk. If I try and extract the files with WinZip, Winzip thinks the archive is corrupt. If I try using Windows Explorer, I am able to extract it into a single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than the original .zip. Any help would be much appreciated. Sincerely, Philip Boulton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080418/97d89793/attachment-0017.html From tjarvi at qbang.org Fri Apr 18 19:07:00 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 18 Apr 2008 19:07:00 -0600 (MDT) Subject: [Rxtx] Difficulty opening zip file at rxtx site In-Reply-To: <480904D5.1060307@pulsetracer.com> References: <480904D5.1060307@pulsetracer.com> Message-ID: On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org From pboulton at pulsetracer.com Sat Apr 19 12:46:26 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Sat, 19 Apr 2008 11:46:26 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site References: <480904D5.1060307@pulsetracer.com> Message-ID: <53DB7576450695419E09299104043761A78533@ZTGSERVER.ztg.local> I have been able to get my hands on the binaries, by going to the ftp directory /pub/rxtx at ftp.qbang.org,, and ftping the file rxtx-2.1-7-bins-r2.zip . This opens happily with Winzip, and extracts as the set of files that you describe below. I only experience the ill-formed archive problem by clicking the link on the rxtx.org Downloads page (http://rxtx.qbang.org/pub/rxtx/ rxtx-2.1-7-bins-r2.zip ). Not sure what to make of that. Philip Boulton ________________________________ From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Fri 4/18/2008 6:07 PM To: Philip Boulton Cc: rxtx at qbang.org Subject: Re: [Rxtx] Difficulty opening zip file at rxtx site On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080419/147923bb/attachment-0016.html From jlar310 at gmail.com Sat Apr 19 19:11:55 2008 From: jlar310 at gmail.com (Jeff Larsen) Date: Sat, 19 Apr 2008 20:11:55 -0500 Subject: [Rxtx] Moxa serial over Ethernet driver Message-ID: Hi all, I've been using javax.comm for years to communicate with a legacy radio data system. We want to migrate the java side of the system to a VMware Server virtual machine. We've had great success using Moxa DE-303 and 5610 serial over Ethernet appliances and virtual machines for running hylafax. The OS (Linux in this case) uses a kernel driver to communicate with the Moxa via a virtual serial port such as /dev/ttyr00. I want to do the same thing with javax.comm or gnu.io to connect to a virtual serial port. However I'm hitting road blocks everywhere. javax.comm for Linux sees the virtual port, but there are transmission errors. Tried Solaris too, but the Solaris Moxa drivers don't play nice with javax.comm because the driver uses /dev/pts/n instead of /dev/term/x. Next I tried RXTX on Linux, but I'm getting NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX on Solaris. Has anyone used RXTX with serial over Ethernet devices? Any hints on how to make it work? I know that I'm not completely off track because javax.comm does work with Moxa on a Windows platform, but that's just not an option for production deployment. -- Jeff From tjarvi at qbang.org Sat Apr 19 21:08:41 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 19 Apr 2008 21:08:41 -0600 (MDT) Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: yOn Sat, 19 Apr 2008, Jeff Larsen wrote: > Hi all, > > I've been using javax.comm for years to communicate with a legacy > radio data system. We want to migrate the java side of the system to a > VMware Server virtual machine. We've had great success using Moxa > DE-303 and 5610 serial over Ethernet appliances and virtual machines > for running hylafax. The OS (Linux in this case) uses a kernel driver > to communicate with the Moxa via a virtual serial port such as > /dev/ttyr00. > > I want to do the same thing with javax.comm or gnu.io to connect to a > virtual serial port. However I'm hitting road blocks everywhere. > javax.comm for Linux sees the virtual port, but there are transmission > errors. Tried Solaris too, but the Solaris Moxa drivers don't play > nice with javax.comm because the driver uses /dev/pts/n instead of > /dev/term/x. Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris. > > Has anyone used RXTX with serial over Ethernet devices? Any hints on > how to make it work? > > I know that I'm not completely off track because javax.comm does work > with Moxa on a Windows platform, but that's just not an option for > production deployment. > > Moxa should work under linux. There may be minor issues depending upon how complete the kernel driver is but I think it will work. One of the minor issues is /dev/ttyr00 is not enumerated. There are several work arounds documented with the source code and on the wiki. The easiest solution for testing purposes is to make a symbolic link from /dev/ttyr00 to a port that is enumerated such as /dev/ttyS129. You can later alter the rxtx source or use properties to change the enumerated ports. -- Trent Jarvi tjarvi at qbang.org From d.tonhofer at m-plify.com Sun Apr 20 03:33:30 2008 From: d.tonhofer at m-plify.com (David Tonhofer (M-PLIFY S.A.)) Date: Sun, 20 Apr 2008 11:33:30 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: <480B0DEA.5010908@m-plify.com> Jeff Larsen wrote: > Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris It might be that the Java side of RXTX does not recognize that portname. Trying modifying src/RXTXCommDriver.java as described in this case: http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card From ajmas at sympatico.ca Sun Apr 20 16:37:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Apr 2008 18:37:59 -0400 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <480B0DEA.5010908@m-plify.com> References: <480B0DEA.5010908@m-plify.com> Message-ID: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > Jeff Larsen wrote: >> Next I tried RXTX on Linux, but I'm getting >> NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX >> on Solaris > It might be that the Java side of RXTX does not recognize that > portname. > Trying modifying src/RXTXCommDriver.java as described in this case: > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card I wonder whether it would be worth allowing custom port prefixes as a system parameter? For example: gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" Andre From Martin.Oberhuber at windriver.com Tue Apr 22 12:34:36 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 22 Apr 2008 20:34:36 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> References: <480B0DEA.5010908@m-plify.com> <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE6485848056CD6CE@ism-mail03.corp.ad.wrs.com> Sounds like a great idea... I'm wondering how the "variable part" after the Prefixes could be specified though? What about allowing Regular Expression character Classes in the existing System Property for specifying ports: System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyS[0-9],ttyS[ABC],ttyUSB[0-9a-z]"); The set of allowed patterns would of course need to Be restricted compared to REGEX, because it must be A syntax that supports iterating over it. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Montag, 21. April 2008 00:38 > To: rxtx at qbang.org and Users > Subject: Re: [Rxtx] Moxa serial over Ethernet driver > > > On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > > Jeff Larsen wrote: > >> Next I tried RXTX on Linux, but I'm getting > >> NoSuchPortException connecting to /dev/ttyr00. I have yet > to try RXTX > >> on Solaris > > It might be that the Java side of RXTX does not recognize that > > portname. > > Trying modifying src/RXTXCommDriver.java as described in this case: > > > > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_ > SST-4P.2FLP_multiport_card > > I wonder whether it would be worth allowing custom port > prefixes as a > system parameter? For > example: > > gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Loi.TRAN at weatherford.com Tue Apr 22 13:10:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Tue, 22 Apr 2008 14:10:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled Message-ID: Hi, I'm currently using the Java RXTX API to interface to a serial port. The serial port is connected to a bridge board that communicates with our communications system running at 1.875 Mbps which is linked to an embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no flow control). I send a command to the embedded board through the serial-bridge board which then is relayed to the embedded board. The command sent asks the embedded board to dump a binary image. Here's where I'm hitting some problems. I've successfully done this is an integrated serial port from the laptop. The binary file that comes back is consistent on every attempt. When I use the application I've written to do the same thing with a USB-to-serial adapter, the image I get back is not the same as the image I receive through the USB-to-serial adapter is not consistent at all. A final thing is that when I use a terminal program to dump the binary image with the USB-serial adapter, the image is correct. Every time! What is the terminal program doing that's not being done in my application? My application is quite simple. Has anyone observed this behavior before? If you have, I'd like to know how you've gotten around this problem. Thanks, LT =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From tjarvi at qbang.org Tue Apr 22 21:11:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 22 Apr 2008 21:11:10 -0600 (MDT) Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org From Loi.TRAN at weatherford.com Wed Apr 23 08:35:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Wed, 23 Apr 2008 09:35:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: Thanks for all the responses. I finally tried something that worked consistently. I updated my Prolific driver and repeated my tests. It worked. If you're using the Prolific type USB-serial adapters, do no use the Prolific version 2.0.2.1 driver on Windows. Update it to the latest 2.0.2.8 version. Again, thanks for all the responses. LT -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Tuesday, April 22, 2008 10:11 PM To: TRAN, Loi X. Cc: rxtx at qbang.org Subject: Re: [Rxtx] Prolific USB - RXTX data mangled On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From Martin.Oberhuber at windriver.com Wed Apr 23 18:54:26 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 02:54:26 +0200 Subject: [Rxtx] RXTX port locking on Linux status? Message-ID: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Dear RXTX community, I'm wondering what the status is with RXTX locking serial ports on Linux? My understanding is that the mechanism used in 2.1-7r2 (lockfiles) is not really state of the art, and has lots of problems (e.g. missing permissions). There was an idea to migrate towards a Kernel syscall based solution for port locking. What's the status here? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/9878db9f/attachment-0012.html From tjarvi at qbang.org Wed Apr 23 20:32:24 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Apr 2008 20:32:24 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > Dear RXTX community, > > I'm wondering what the status is with RXTX locking > serial ports on Linux? > > My understanding is that the mechanism used in > 2.1-7r2 (lockfiles) is not really state of the art, and > has lots of problems (e.g. missing permissions). > > There was an idea to migrate towards a Kernel > syscall based solution for port locking. > > What's the status here? > Hi Martin, I'm in favor of deprecating the current FHS locking mechanism in favor of an IOCTL when available. I think it will be available on all the platforms but do not know for sure. The status is unchanged. I've had very few free cycles for such things. Feel free to take a stab at it if you have some time. I believe the IOCTL is used in the Mac OS X code already. I don't see any real backwards compatability issues and the IOCTL should just work. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Apr 24 06:14:06 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 14:14:06 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Thanks Trent. Problem is only that I'm really not at all Familiar with the C part of RXTX. If there Were anything I could do in Java for this, It would be easier for me.... ... Are there any C experts here on the list Who'd like to look at ioctl port locking For linux? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Donnerstag, 24. April 2008 04:32 > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > I'm wondering what the status is with RXTX locking > > serial ports on Linux? > > > > My understanding is that the mechanism used in > > 2.1-7r2 (lockfiles) is not really state of the art, and > > has lots of problems (e.g. missing permissions). > > > > There was an idea to migrate towards a Kernel > > syscall based solution for port locking. > > > > What's the status here? > > > > Hi Martin, > > I'm in favor of deprecating the current FHS locking mechanism > in favor of > an IOCTL when available. I think it will be available on all the > platforms but do not know for sure. > > The status is unchanged. I've had very few free cycles for > such things. > Feel free to take a stab at it if you have some time. I > believe the IOCTL > is used in the Mac OS X code already. > > I don't see any real backwards compatability issues and the > IOCTL should > just work. > > -- > Trent Jarvi > tjarvi at qbang.org > From sspies at sloc.de Thu Apr 24 07:15:36 2008 From: sspies at sloc.de (Sebastian Spies) Date: Thu, 24 Apr 2008 15:15:36 +0200 (CEST) Subject: [Rxtx] rxtx on gumstix: Interrupted system call In-Reply-To: <47FB7B20.7080504@sloc.de> References: <47FB7B20.7080504@sloc.de> Message-ID: <55445.130.83.139.205.1209042936.squirrel@ssl.sloc.de> Dear list, while porting rxtx to the gumstix, I found out, that select used in readArray in SerialImp.c might not work as expected. Maybe, because of missing TIOCSERGETLSR-support? select is often interrupted, so i wrote the following quick'n'dirty hack to make it work on gumstix: diff -Nur rxtx-2.1-7r2/src/SerialImp.c rxtx-2.1-7r2/src/SerialImp.c --- rxtx-2.1-7r2/src/SerialImp.c 2006-01-29 23:19:04.000000000 +0100 +++ rxtx-2.1-7r2-patched/src/SerialImp.c 2008-04-24 14:30:17.000000000 +0200 @@ -3380,7 +3381,7 @@ JNIEXPORT jint JNICALL RXTXPort(readArray)( JNIEnv *env, jobject jobj, jbyteArray jbarray, jint offset, jint length ) { - int bytes; + int bytes = 0; jbyte *body; /* char msg[80]; */ int fd = get_java_var( env, jobj, "fd", "I" ); @@ -3397,9 +3398,18 @@ "readArray", "Invalid length" ); return -1; } - body = (*env)->GetByteArrayElements( env, jbarray, 0 ); - bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ - (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + while(1 > bytes) + { + body = (*env)->GetByteArrayElements( env, jbarray, 0 ); + bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ + (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + // quick'n'dirty - SSP + report (" trying again... \n"); + errno = 0; + } + if( bytes < 0 ) { report( "RXTXPort:readArray bytes < 0" ); LEAVE( "RXTXPort:readArray" ); > Hey, > > I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use > RXTXPort$SerialInputStream.read(), then I get the following Exception. I > did not yet figure out which system call is interrupted as strace > produces loads of output. > > Any help would be very appreciated. Thanks in advance. > Sebastian > > > [java] java.io.IOException: Interrupted system call in readArray > [java] at gnu.io.RXTXPort.readArray(Native Method) > [java] at > gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) > [java] at > java.io.FilterInputStream.read(FilterInputStream.java:189) > [java] at > java.io.BufferedInputStream.refill(BufferedInputStream.java:371) > [java] at > java.io.BufferedInputStream.read(BufferedInputStream.java:229) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) > [java] at > com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) > > -- > Sebastian Spies > > mail: sspies at sloc.de > > > > From fire_baptized at hotmail.com Thu Apr 24 18:27:48 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Thu, 24 Apr 2008 20:27:48 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hello I am having a problem with the serial device connecting (software wise) to the serial port. However I have a test program and it seems to work just fine in that environment - and it doesnt use GUI. The error I am getting is : PortNotFoundException Now the way I have it setup in the GUI environment is that once the user pushes a JButton the program connects using this class: protected void establishConnection() { try { portId = CommPortIdentifier.getPortIdentifier("COM3"); System.out.println("Establishing connction....."); messages[0] = "\nEstablishing connction.....\n"; } catch ( NoSuchPortException noport) { System.out.println("Port not found: "+ noport); messages[0] = "Port not found: "+ noport+"\n"; } try { serialPort = (SerialPort) portId.open("serial", 50); System.out.println("Port has been found."); messages[1] = "Port has been found.\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[1] = "" +usedport; } try { serialPort = (SerialPort) portId.open("serial", 50); messages[2] = "Connecting to COM3 on port 50....\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; } try { serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); System.out.println("Esablishing the transfer rate settings for COM3."); messages[3] = "Esablishing the transfer rate settings for COM3.\n"; } catch (UnsupportedCommOperationException nosupcom) { System.out.println(nosupcom); System.out.println("The tranfer rate could not be esblished on COM3."); messages[3] = "The tranfer rate could not be esblished on COM3.\n"; } System.out.println(serialPort.getFlowControlMode()); messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; //sendDataOut(buffer[3],buffer[4]); } I need all the data in this method (and all the string values in this method) to be printed out on a JTextArea. I wont do me any good if not all the text is printed on a JTextArea in another class. So I have the text printing the JTextArea correctly, but everytime the JButton is activated - it gives me that error message. I did add a disconnect button that is supposed to call the serialPort.close(). _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/273fd4ec/attachment-0011.html From tjarvi at qbang.org Thu Apr 24 21:54:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Apr 2008 21:54:10 -0600 (MDT) Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > Hello I am having a problem with the serial device connecting (software > wise) to the serial port. However I have a test program and it seems to > work just fine in that environment - and it doesnt use GUI. The error I > am getting is : PortNotFoundException Now the way I have it setup in the > GUI environment is that once the user pushes a JButton the program > connects using this class: > > protected void establishConnection() { > try { > portId = CommPortIdentifier.getPortIdentifier("COM3"); > System.out.println("Establishing connction....."); > messages[0] = "\nEstablishing connction.....\n"; > } > catch ( NoSuchPortException noport) { > System.out.println("Port not found: "+ noport); > messages[0] = "Port not found: "+ noport+"\n"; > } > try { > serialPort = (SerialPort) portId.open("serial", 50); > System.out.println("Port has been found."); > messages[1] = "Port has been found.\n"; > } > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[1] = "" +usedport; > } ================================================================= > try { > serialPort = (SerialPort) portId.open("serial", 50); > messages[2] = "Connecting to COM3 on port 50....\n"; > } ================================================================== > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > } > try { > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > System.out.println("Esablishing the transfer rate settings for COM3."); > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > } > catch (UnsupportedCommOperationException nosupcom) { > System.out.println(nosupcom); > System.out.println("The tranfer rate could not be esblished on COM3."); > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > } > System.out.println(serialPort.getFlowControlMode()); > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > //sendDataOut(buffer[3],buffer[4]); > } > > I need all the data in this method (and all the string values in this > method) to be printed out on a JTextArea. I wont do me any good if not > all the text is printed on a JTextArea in another class. So I have the > text printing the JTextArea correctly, but everytime the JButton is > activated - it gives me that error message. I did add a disconnect > button that is supposed to call the serialPort.close(). > The open code used twice is going to throw an exception. It may be that you catch the exception above this code and print a confusing message? A common mistake is people will accidently run two copies of their program. The first instance of the program will open the port and prevent enumeration (finding the port) in the second instance of the program. As an example, you may be running your text based application which is preventing the GUI from seeing the port. Enumeration is done by trying to open the port. If the port is open, Enumeration fails. -- Trent Jarvi tjarvi at qbang.org From fire_baptized at hotmail.com Thu Apr 24 22:32:05 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 00:32:05 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Wow - thanks dude what a dumb thing for me to not catch..... now here is the current problem - right now I am trying to output data again one is with the test program - and it seems that serialPort.setRTS(true); is throwing an exceptions there - now if I show this code please bare in mind that I am only testing - the code is kinda sloppy in my mind - but if I can figure out why calling this function is throwing an exception then maybe I can figure out why my GUI application is getting the same null pointer exceptions when try to send out the data stream. FYI Trent this email is not directed towards you - anyone can jump in on this public static void main(String args[]) { byte[] b = new byte[64]; int keyinput = 0 ; byte x = 0; byte y = 0; PortTesting1 testports = new PortTesting1(); try { joyskoro = Joystick.createInstance(); } catch (IOException ioexc) { System.out.println("There is an input/output problem: " + ioexc); } while (true) { joyskoro.poll(); b[0] = ((byte) -(10 * joyskoro.getY())); b[1] = ((byte) (10 * joyskoro.getX())); System.out.println("The 3rd byte is: " +b[0]); System.out.println("The 4rd byte is: " +b[1]); serialPort.setRTS(true); // HERE IS WHERE THE PROBLEM IS !!!!!!! ON THIS LINE but if I dont have it active in my program the Bluetooth device (that is System.out.println("Ready to send :-) !"); //connected to the serial port does not send out data!!!!! if (joyskoro.isButtonDown(joyskoro.BUTTON10)) { System.out.println("Connection terminated."); serialPort.close(); break; } if (joyskoro.isButtonDown(joyskoro.BUTTON2)) { boolean flag = true; //reading from key input from the keyboard System.out.println("Please input a command: "); while (flag) { try { keyinput = System.in.read(); } catch (IOException ioexc) {/*there is no need to put * anything here */ } if((char)keyinput=='w') { pushIt((byte)85); } if((char)keyinput=='s') { pushIt((byte)84); } if((char)keyinput=='a') { pushIt((byte)83); } if((char)keyinput=='d') { pushIt((byte)82); } if((char)keyinput=='q') { pushIt((byte)89); } if((char)keyinput=='\t') { //this stop reading input from the keyboard flag = false; } } and help anyways here is the block of code that throwing an exception for the test program: > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/5c8f7d68/attachment-0011.html From fire_baptized at hotmail.com Fri Apr 25 07:59:53 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 09:59:53 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Are there any examples of how to push out data? As in using input and output streams - if I can compare code maybe I can see where this is causing a problem. I have a byte array that I am pushing out data. I keep getting null pointer exceptions every where I turn. > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/22228ab6/attachment-0010.html From ajmas at sympatico.ca Sat Apr 26 07:37:09 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 26 Apr 2008 09:37:09 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hi, On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote: > > Are there any examples of how to push out data? As in using input > and output streams - if I can compare code maybe I can see where > this is causing a problem. I have a byte array that I am pushing > out data. I keep getting null pointer exceptions every where I turn. > There are some examples here that might be of help: http://rxtx.qbang.org/wiki/index.php/Examples Andre From fire_baptized at hotmail.com Sat Apr 26 20:13:54 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Sat, 26 Apr 2008 22:13:54 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: looked at those....yep didnt help - I need to push out data with GUI and not get a null pointer exception everytime I try. > CC: rxtx at qbang.org> From: ajmas at sympatico.ca> To: fire_baptized at hotmail.com> Subject: Re: [Rxtx] Serial Problems with Gui.....> Date: Sat, 26 Apr 2008 09:37:09 -0400> > Hi,> > > On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote:> >> > Are there any examples of how to push out data? As in using input > > and output streams - if I can compare code maybe I can see where > > this is causing a problem. I have a byte array that I am pushing > > out data. I keep getting null pointer exceptions every where I turn.> >> > There are some examples here that might be of help:> > http://rxtx.qbang.org/wiki/index.php/Examples> > Andre _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080426/09f95b41/attachment-0009.html From michael.erskine at ketech.com Mon Apr 28 02:47:22 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 28 Apr 2008 09:47:22 +0100 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D426EF3CBBC5@no-sv-03.ketech.local> Jesrael D. Summerhill wrote: > looked at those....yep didnt help - I need to push out data with GUI and > not get a null pointer exception everytime I try. So it seems pretty obvious that your code needs to check for nulls wherever one may occur and report what's happening. Alternatively, catch the npe and display the stack trace. Then you can fix your code so it doesn't try to work with something that ain't there. Regards, Michael Erskine. From scldad at sdc.com.au Mon Apr 28 03:58:34 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Mon, 28 Apr 2008 19:28:34 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Message-ID: <200804281928.34454.scldad@sdc.com.au> Has anybody done any design work on this? The first thing that springs to mind is that we still need to check for lock files because other apps tend to use that approach even if we go to ioctl. Cheers, Stephen Davies On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > Thanks Trent. > > Problem is only that I'm really not at all > Familiar with the C part of RXTX. If there > Were anything I could do in Java for this, > It would be easier for me.... > > ... Are there any C experts here on the list > Who'd like to look at ioctl port locking > For linux? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > -----Original Message----- > > From: Trent Jarvi [mailto:tjarvi at qbang.org] > > Sent: Donnerstag, 24. April 2008 04:32 > > To: Oberhuber, Martin > > Cc: rxtx at qbang.org > > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > > > I'm wondering what the status is with RXTX locking > > > serial ports on Linux? > > > > > > My understanding is that the mechanism used in > > > 2.1-7r2 (lockfiles) is not really state of the art, and > > > has lots of problems (e.g. missing permissions). > > > > > > There was an idea to migrate towards a Kernel > > > syscall based solution for port locking. > > > > > > What's the status here? > > > > Hi Martin, > > > > I'm in favor of deprecating the current FHS locking mechanism > > in favor of > > an IOCTL when available. I think it will be available on all the > > platforms but do not know for sure. > > > > The status is unchanged. I've had very few free cycles for > > such things. > > Feel free to take a stab at it if you have some time. I > > believe the IOCTL > > is used in the Mac OS X code already. > > > > I don't see any real backwards compatability issues and the > > IOCTL should > > just work. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Mon Apr 28 04:21:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 28 Apr 2008 04:21:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804281928.34454.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: I don't think there would need to be any architectural changes. A couple ifdefs and minor changes in the current code should be enough. Proposal: FHS/UUCP locks: continue to respect them, try to create them but do not error if the IOCTL is supported. (But does the IOCTL being defined mean it will work?) Enumeration: Do not assert the IOCTL while opening. Serial.open: assert the IOCTL after open. Continue to use locks as described above after asserting the IOCTL. If the IOCTL is defined but not working, handle it here. Failure cases include the IOCTL is not supported and the port is already locked. On Mon, 28 Apr 2008, Stephen Davies wrote: > Has anybody done any design work on this? > The first thing that springs to mind is that we still need to check for lock > files because other apps tend to use that approach even if we go to ioctl. > > Cheers, > Stephen Davies > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: >> Thanks Trent. >> >> Problem is only that I'm really not at all >> Familiar with the C part of RXTX. If there >> Were anything I could do in Java for this, >> It would be easier for me.... >> >> ... Are there any C experts here on the list >> Who'd like to look at ioctl port locking >> For linux? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >>> -----Original Message----- >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] >>> Sent: Donnerstag, 24. April 2008 04:32 >>> To: Oberhuber, Martin >>> Cc: rxtx at qbang.org >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? >>> >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: >>>> Dear RXTX community, >>>> >>>> I'm wondering what the status is with RXTX locking >>>> serial ports on Linux? >>>> >>>> My understanding is that the mechanism used in >>>> 2.1-7r2 (lockfiles) is not really state of the art, and >>>> has lots of problems (e.g. missing permissions). >>>> >>>> There was an idea to migrate towards a Kernel >>>> syscall based solution for port locking. >>>> >>>> What's the status here? >>> >>> Hi Martin, >>> >>> I'm in favor of deprecating the current FHS locking mechanism >>> in favor of >>> an IOCTL when available. I think it will be available on all the >>> platforms but do not know for sure. >>> >>> The status is unchanged. I've had very few free cycles for >>> such things. >>> Feel free to take a stab at it if you have some time. I >>> believe the IOCTL >>> is used in the Mac OS X code already. >>> >>> I don't see any real backwards compatability issues and the >>> IOCTL should >>> just work. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Tue Apr 29 12:04:04 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Apr 2008 20:04:04 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Hi all, The biggest problem that I have seen with lockfiles on Linux At least is, that it seems there is no standard with respect To the folder in which they should be created. Also, many Distributions seem to set up file system permissions in such A way that writing to the lockfile folder is not allowed for The normal user -- that's why we stopped using lockfiles In our commercial product. If we are to still respect lockfiles, we first need to Understand where we are expected to look for them. Does Anybody have any insight what variants of lockfile folder Schema exist out there in the wild? Some apps like minicom Seem to even allow users to manually specify a lockfile Folder of their choice. Because of the difficulty finding the right lockfile folder, And because of the inherent risk of thinking that something Might be locked while it actually isn't, I'd suggest that RXTX should have a "soft-off" feature that allows disabling ALL Lockfile checks at runtime without recompiling the native Sharedlibs. Trent - I like your strategy outline, but I think that it Needs to be configurable by the client such that users and/or Customer Support can disable lockfiles / disable ioctl in Case they detect that they are runing on an OS / Kernal that Does not support one or the other. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Montag, 28. April 2008 12:22 > To: Stephen Davies > Cc: rxtx at qbang.org; Oberhuber, Martin; Trent Jarvi > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > I don't think there would need to be any architectural > changes. A couple > ifdefs and minor changes in the current code should be enough. > > Proposal: > > FHS/UUCP locks: > continue to respect them, try to create them but do not error if > the IOCTL is supported. (But does the IOCTL being defined mean > it will work?) > Enumeration: > Do not assert the IOCTL while opening. > Serial.open: > assert the IOCTL after open. Continue to use locks as described > above after asserting the IOCTL. If the IOCTL is defined but > not working, handle it here. Failure cases include the IOCTL > is not supported and the port is already locked. > > On Mon, 28 Apr 2008, Stephen Davies wrote: > > > Has anybody done any design work on this? > > The first thing that springs to mind is that we still need > to check for lock > > files because other apps tend to use that approach even if > we go to ioctl. > > > > Cheers, > > Stephen Davies > > > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > >> Thanks Trent. > >> > >> Problem is only that I'm really not at all > >> Familiar with the C part of RXTX. If there > >> Were anything I could do in Java for this, > >> It would be easier for me.... > >> > >> ... Are there any C experts here on the list > >> Who'd like to look at ioctl port locking > >> For linux? > >> > >> Thanks, > >> -- > >> Martin Oberhuber, Senior Member of Technical Staff, Wind River > >> Target Management Project Lead, DSDP PMC Member > >> http://www.eclipse.org/dsdp/tm > >> > >>> -----Original Message----- > >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] > >>> Sent: Donnerstag, 24. April 2008 04:32 > >>> To: Oberhuber, Martin > >>> Cc: rxtx at qbang.org > >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? > >>> > >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > >>>> Dear RXTX community, > >>>> > >>>> I'm wondering what the status is with RXTX locking > >>>> serial ports on Linux? > >>>> > >>>> My understanding is that the mechanism used in > >>>> 2.1-7r2 (lockfiles) is not really state of the art, and > >>>> has lots of problems (e.g. missing permissions). > >>>> > >>>> There was an idea to migrate towards a Kernel > >>>> syscall based solution for port locking. > >>>> > >>>> What's the status here? > >>> > >>> Hi Martin, > >>> > >>> I'm in favor of deprecating the current FHS locking mechanism > >>> in favor of > >>> an IOCTL when available. I think it will be available on all the > >>> platforms but do not know for sure. > >>> > >>> The status is unchanged. I've had very few free cycles for > >>> such things. > >>> Feel free to take a stab at it if you have some time. I > >>> believe the IOCTL > >>> is used in the Mac OS X code already. > >>> > >>> I don't see any real backwards compatability issues and the > >>> IOCTL should > >>> just work. > >>> > >>> -- > >>> Trent Jarvi > >>> tjarvi at qbang.org > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > From Steffen.DETTMER at ingenico.com Tue Apr 29 13:34:44 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 29 Apr 2008 21:34:44 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Message-ID: <20080429193444.GU2928@elberon.bln.de.ingenico.com> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > The biggest problem that I have seen with lockfiles on Linux > At least is, that it seems there is no standard with respect > To the folder in which they should be created. Also, many > Distributions seem to set up file system permissions in such > A way that writing to the lockfile folder is not allowed for > The normal user -- that's why we stopped using lockfiles > In our commercial product. It seems it depends on the expectations. I consider it as a feature that by default a linux user cannot access serial ports. Maybe root connected a modem (can produce phone bills) or even some serial card reader, maybe with the web servers key pair. I would expect that by default a user cannot open the serial port because of insufficient permissions on the device file. I would expect this on other unices as well (but I don't know it). For windows I think it should be similar but not impacting so much in practice, because often windows users work with big permissions on a somewhat high priviledge level or even Administrator. > If we are to still respect lockfiles, we first need to > Understand where we are expected to look for them. Does > Anybody have any insight what variants of lockfile folder > Schema exist out there in the wild? Some apps like minicom > Seem to even allow users to manually specify a lockfile > Folder of their choice. At least my (ancient) minicom does not allow the user to change this option, it is displayed but read-only, but root is allowed to change it. > Because of the difficulty finding the right lockfile folder, > And because of the inherent risk of thinking that something > Might be locked while it actually isn't, I'd suggest that > RXTX should have a "soft-off" feature that allows disabling > ALL Lockfile checks at runtime without recompiling the native > Sharedlibs. sounds very reasonable, yes... and as admin I would not wish that users could skip such locking because they do things wrong by default ;) (in the end I guess that is related to the dilemma, that hotplug/user-owned-periphery and multi-user systems simply conflict) > Trent - I like your strategy outline, but I think that it > Needs to be configurable by the client such that users and/or > Customer Support can disable lockfiles / disable ioctl in > Case they detect that they are runing on an OS / Kernal that > Does not support one or the other. Yes, this would be good I guess... Applications could offer configuration options to control that, maybe similarily as minicom. BTW, man minicom tells: *B - Lock file location On most systems This should be /usr/spool/uucp. Linux systems use /var/lock. If this directory does not exist, minicom will not attempt to use lockfiles. The statement `Linux systems use /var/lock' is interesting, does anyone know the source of this convention? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Tue Apr 29 16:11:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Apr 2008 16:11:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? These details are outlined in the Filesystem Hierarchy Standard (FHS). http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLOCKLOCKFILES -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Tue Apr 29 18:58:09 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Wed, 30 Apr 2008 10:28:09 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: <200804301028.09307.scldad@sdc.com.au> I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is the same. Any ideas as to how to handle this? Stephen On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: > * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > > The biggest problem that I have seen with lockfiles on Linux > > At least is, that it seems there is no standard with respect > > To the folder in which they should be created. Also, many > > Distributions seem to set up file system permissions in such > > A way that writing to the lockfile folder is not allowed for > > The normal user -- that's why we stopped using lockfiles > > In our commercial product. > > It seems it depends on the expectations. I consider it as a > feature that by default a linux user cannot access serial ports. > Maybe root connected a modem (can produce phone bills) or even > some serial card reader, maybe with the web servers key pair. > > I would expect that by default a user cannot open the serial port > because of insufficient permissions on the device file. I would > expect this on other unices as well (but I don't know it). > > For windows I think it should be similar but not impacting so > much in practice, because often windows users work with big > permissions on a somewhat high priviledge level or even > Administrator. > > > If we are to still respect lockfiles, we first need to > > Understand where we are expected to look for them. Does > > Anybody have any insight what variants of lockfile folder > > Schema exist out there in the wild? Some apps like minicom > > Seem to even allow users to manually specify a lockfile > > Folder of their choice. > > At least my (ancient) minicom does not allow the user to change > this option, it is displayed but read-only, but root is allowed > to change it. > > > Because of the difficulty finding the right lockfile folder, > > And because of the inherent risk of thinking that something > > Might be locked while it actually isn't, I'd suggest that > > RXTX should have a "soft-off" feature that allows disabling > > ALL Lockfile checks at runtime without recompiling the native > > Sharedlibs. > > sounds very reasonable, yes... > and as admin I would not wish that users could skip such > locking because they do things wrong by default ;) > > (in the end I guess that is related to the dilemma, that > hotplug/user-owned-periphery and multi-user systems simply > conflict) > > > Trent - I like your strategy outline, but I think that it > > Needs to be configurable by the client such that users and/or > > Customer Support can disable lockfiles / disable ioctl in > > Case they detect that they are runing on an OS / Kernal that > > Does not support one or the other. > > Yes, this would be good I guess... Applications could offer > configuration options to control that, maybe similarily as > minicom. > > BTW, man minicom tells: > > *B - Lock file location > On most systems This should be /usr/spool/uucp. > Linux systems use /var/lock. If this directory > does not exist, minicom will not attempt to use > lockfiles. > > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure > and expedient electronic transaction acceptance. Ingenico products leverage > proven technology, established standards and unparalleled ergonomics to > provide optimal reliability, versatility and usability. This comprehensive > range of products is complemented by a global array of services and > partnerships, enabling businesses in a number of vertical sectors to accept > transactions anywhere their business takes them. www.ingenico.com This > message may contain confidential and/or privileged information. If you are > not the addressee or authorized to receive this for the addressee, you must > not use, copy, disclose or take any action based on this message or any > information herein. If you have received this message in error, please > advise the sender immediately by reply e-mail and delete this message. > Thank you for your cooperation. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Wed Apr 30 19:30:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 30 Apr 2008 19:30:51 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804301028.09307.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> <200804301028.09307.scldad@sdc.com.au> Message-ID: Hi Stephen, I suspect ioctl/TIOCEXCL open/O_EXCL would do the job. Mac uses TIOCEXCL and it is POSIX. We use O_EXCL for lockfiles on Linux already. On Wed, 30 Apr 2008, Stephen Davies wrote: > I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is > the same. > > Any ideas as to how to handle this? > > Stephen > > > On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: >> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: >>> The biggest problem that I have seen with lockfiles on Linux >>> At least is, that it seems there is no standard with respect >>> To the folder in which they should be created. Also, many >>> Distributions seem to set up file system permissions in such >>> A way that writing to the lockfile folder is not allowed for >>> The normal user -- that's why we stopped using lockfiles >>> In our commercial product. >> >> It seems it depends on the expectations. I consider it as a >> feature that by default a linux user cannot access serial ports. >> Maybe root connected a modem (can produce phone bills) or even >> some serial card reader, maybe with the web servers key pair. >> >> I would expect that by default a user cannot open the serial port >> because of insufficient permissions on the device file. I would >> expect this on other unices as well (but I don't know it). >> >> For windows I think it should be similar but not impacting so >> much in practice, because often windows users work with big >> permissions on a somewhat high priviledge level or even >> Administrator. >> >>> If we are to still respect lockfiles, we first need to >>> Understand where we are expected to look for them. Does >>> Anybody have any insight what variants of lockfile folder >>> Schema exist out there in the wild? Some apps like minicom >>> Seem to even allow users to manually specify a lockfile >>> Folder of their choice. >> >> At least my (ancient) minicom does not allow the user to change >> this option, it is displayed but read-only, but root is allowed >> to change it. >> >>> Because of the difficulty finding the right lockfile folder, >>> And because of the inherent risk of thinking that something >>> Might be locked while it actually isn't, I'd suggest that >>> RXTX should have a "soft-off" feature that allows disabling >>> ALL Lockfile checks at runtime without recompiling the native >>> Sharedlibs. >> >> sounds very reasonable, yes... >> and as admin I would not wish that users could skip such >> locking because they do things wrong by default ;) >> >> (in the end I guess that is related to the dilemma, that >> hotplug/user-owned-periphery and multi-user systems simply >> conflict) >> >>> Trent - I like your strategy outline, but I think that it >>> Needs to be configurable by the client such that users and/or >>> Customer Support can disable lockfiles / disable ioctl in >>> Case they detect that they are runing on an OS / Kernal that >>> Does not support one or the other. >> >> Yes, this would be good I guess... Applications could offer >> configuration options to control that, maybe similarily as >> minicom. >> >> BTW, man minicom tells: >> >> *B - Lock file location >> On most systems This should be /usr/spool/uucp. >> Linux systems use /var/lock. If this directory >> does not exist, minicom will not attempt to use >> lockfiles. >> >> The statement `Linux systems use /var/lock' is interesting, does >> anyone know the source of this convention? >> >> oki, >> >> Steffen >> >> About Ingenico Throughout the world businesses rely on Ingenico for secure >> and expedient electronic transaction acceptance. Ingenico products leverage >> proven technology, established standards and unparalleled ergonomics to >> provide optimal reliability, versatility and usability. This comprehensive >> range of products is complemented by a global array of services and >> partnerships, enabling businesses in a number of vertical sectors to accept >> transactions anywhere their business takes them. www.ingenico.com This >> message may contain confidential and/or privileged information. If you are >> not the addressee or authorized to receive this for the addressee, you must >> not use, copy, disclose or take any action based on this message or any >> information herein. If you have received this message in error, please >> advise the sender immediately by reply e-mail and delete this message. >> Thank you for your cooperation. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0035.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0033.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0020.html From pboulton at pulsetracer.com Fri Apr 18 14:30:13 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Fri, 18 Apr 2008 13:30:13 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site Message-ID: <480904D5.1060307@pulsetracer.com> Hello, gentle serial porters. I have downloaded the zipped up binaries for use on Windows without Sun's CommAPI, but don't seem able to extract anything from the download. Go to main page, http://www.rxtx.org/ Click on Downloads I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) And I save it to disk. If I try and extract the files with WinZip, Winzip thinks the archive is corrupt. If I try using Windows Explorer, I am able to extract it into a single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than the original .zip. Any help would be much appreciated. Sincerely, Philip Boulton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080418/97d89793/attachment-0018.html From tjarvi at qbang.org Fri Apr 18 19:07:00 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 18 Apr 2008 19:07:00 -0600 (MDT) Subject: [Rxtx] Difficulty opening zip file at rxtx site In-Reply-To: <480904D5.1060307@pulsetracer.com> References: <480904D5.1060307@pulsetracer.com> Message-ID: On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org From pboulton at pulsetracer.com Sat Apr 19 12:46:26 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Sat, 19 Apr 2008 11:46:26 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site References: <480904D5.1060307@pulsetracer.com> Message-ID: <53DB7576450695419E09299104043761A78533@ZTGSERVER.ztg.local> I have been able to get my hands on the binaries, by going to the ftp directory /pub/rxtx at ftp.qbang.org,, and ftping the file rxtx-2.1-7-bins-r2.zip . This opens happily with Winzip, and extracts as the set of files that you describe below. I only experience the ill-formed archive problem by clicking the link on the rxtx.org Downloads page (http://rxtx.qbang.org/pub/rxtx/ rxtx-2.1-7-bins-r2.zip ). Not sure what to make of that. Philip Boulton ________________________________ From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Fri 4/18/2008 6:07 PM To: Philip Boulton Cc: rxtx at qbang.org Subject: Re: [Rxtx] Difficulty opening zip file at rxtx site On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080419/147923bb/attachment-0017.html From jlar310 at gmail.com Sat Apr 19 19:11:55 2008 From: jlar310 at gmail.com (Jeff Larsen) Date: Sat, 19 Apr 2008 20:11:55 -0500 Subject: [Rxtx] Moxa serial over Ethernet driver Message-ID: Hi all, I've been using javax.comm for years to communicate with a legacy radio data system. We want to migrate the java side of the system to a VMware Server virtual machine. We've had great success using Moxa DE-303 and 5610 serial over Ethernet appliances and virtual machines for running hylafax. The OS (Linux in this case) uses a kernel driver to communicate with the Moxa via a virtual serial port such as /dev/ttyr00. I want to do the same thing with javax.comm or gnu.io to connect to a virtual serial port. However I'm hitting road blocks everywhere. javax.comm for Linux sees the virtual port, but there are transmission errors. Tried Solaris too, but the Solaris Moxa drivers don't play nice with javax.comm because the driver uses /dev/pts/n instead of /dev/term/x. Next I tried RXTX on Linux, but I'm getting NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX on Solaris. Has anyone used RXTX with serial over Ethernet devices? Any hints on how to make it work? I know that I'm not completely off track because javax.comm does work with Moxa on a Windows platform, but that's just not an option for production deployment. -- Jeff From tjarvi at qbang.org Sat Apr 19 21:08:41 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 19 Apr 2008 21:08:41 -0600 (MDT) Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: yOn Sat, 19 Apr 2008, Jeff Larsen wrote: > Hi all, > > I've been using javax.comm for years to communicate with a legacy > radio data system. We want to migrate the java side of the system to a > VMware Server virtual machine. We've had great success using Moxa > DE-303 and 5610 serial over Ethernet appliances and virtual machines > for running hylafax. The OS (Linux in this case) uses a kernel driver > to communicate with the Moxa via a virtual serial port such as > /dev/ttyr00. > > I want to do the same thing with javax.comm or gnu.io to connect to a > virtual serial port. However I'm hitting road blocks everywhere. > javax.comm for Linux sees the virtual port, but there are transmission > errors. Tried Solaris too, but the Solaris Moxa drivers don't play > nice with javax.comm because the driver uses /dev/pts/n instead of > /dev/term/x. Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris. > > Has anyone used RXTX with serial over Ethernet devices? Any hints on > how to make it work? > > I know that I'm not completely off track because javax.comm does work > with Moxa on a Windows platform, but that's just not an option for > production deployment. > > Moxa should work under linux. There may be minor issues depending upon how complete the kernel driver is but I think it will work. One of the minor issues is /dev/ttyr00 is not enumerated. There are several work arounds documented with the source code and on the wiki. The easiest solution for testing purposes is to make a symbolic link from /dev/ttyr00 to a port that is enumerated such as /dev/ttyS129. You can later alter the rxtx source or use properties to change the enumerated ports. -- Trent Jarvi tjarvi at qbang.org From d.tonhofer at m-plify.com Sun Apr 20 03:33:30 2008 From: d.tonhofer at m-plify.com (David Tonhofer (M-PLIFY S.A.)) Date: Sun, 20 Apr 2008 11:33:30 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: <480B0DEA.5010908@m-plify.com> Jeff Larsen wrote: > Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris It might be that the Java side of RXTX does not recognize that portname. Trying modifying src/RXTXCommDriver.java as described in this case: http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card From ajmas at sympatico.ca Sun Apr 20 16:37:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Apr 2008 18:37:59 -0400 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <480B0DEA.5010908@m-plify.com> References: <480B0DEA.5010908@m-plify.com> Message-ID: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > Jeff Larsen wrote: >> Next I tried RXTX on Linux, but I'm getting >> NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX >> on Solaris > It might be that the Java side of RXTX does not recognize that > portname. > Trying modifying src/RXTXCommDriver.java as described in this case: > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card I wonder whether it would be worth allowing custom port prefixes as a system parameter? For example: gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" Andre From Martin.Oberhuber at windriver.com Tue Apr 22 12:34:36 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 22 Apr 2008 20:34:36 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> References: <480B0DEA.5010908@m-plify.com> <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE6485848056CD6CE@ism-mail03.corp.ad.wrs.com> Sounds like a great idea... I'm wondering how the "variable part" after the Prefixes could be specified though? What about allowing Regular Expression character Classes in the existing System Property for specifying ports: System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyS[0-9],ttyS[ABC],ttyUSB[0-9a-z]"); The set of allowed patterns would of course need to Be restricted compared to REGEX, because it must be A syntax that supports iterating over it. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Montag, 21. April 2008 00:38 > To: rxtx at qbang.org and Users > Subject: Re: [Rxtx] Moxa serial over Ethernet driver > > > On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > > Jeff Larsen wrote: > >> Next I tried RXTX on Linux, but I'm getting > >> NoSuchPortException connecting to /dev/ttyr00. I have yet > to try RXTX > >> on Solaris > > It might be that the Java side of RXTX does not recognize that > > portname. > > Trying modifying src/RXTXCommDriver.java as described in this case: > > > > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_ > SST-4P.2FLP_multiport_card > > I wonder whether it would be worth allowing custom port > prefixes as a > system parameter? For > example: > > gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Loi.TRAN at weatherford.com Tue Apr 22 13:10:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Tue, 22 Apr 2008 14:10:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled Message-ID: Hi, I'm currently using the Java RXTX API to interface to a serial port. The serial port is connected to a bridge board that communicates with our communications system running at 1.875 Mbps which is linked to an embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no flow control). I send a command to the embedded board through the serial-bridge board which then is relayed to the embedded board. The command sent asks the embedded board to dump a binary image. Here's where I'm hitting some problems. I've successfully done this is an integrated serial port from the laptop. The binary file that comes back is consistent on every attempt. When I use the application I've written to do the same thing with a USB-to-serial adapter, the image I get back is not the same as the image I receive through the USB-to-serial adapter is not consistent at all. A final thing is that when I use a terminal program to dump the binary image with the USB-serial adapter, the image is correct. Every time! What is the terminal program doing that's not being done in my application? My application is quite simple. Has anyone observed this behavior before? If you have, I'd like to know how you've gotten around this problem. Thanks, LT =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From tjarvi at qbang.org Tue Apr 22 21:11:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 22 Apr 2008 21:11:10 -0600 (MDT) Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org From Loi.TRAN at weatherford.com Wed Apr 23 08:35:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Wed, 23 Apr 2008 09:35:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: Thanks for all the responses. I finally tried something that worked consistently. I updated my Prolific driver and repeated my tests. It worked. If you're using the Prolific type USB-serial adapters, do no use the Prolific version 2.0.2.1 driver on Windows. Update it to the latest 2.0.2.8 version. Again, thanks for all the responses. LT -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Tuesday, April 22, 2008 10:11 PM To: TRAN, Loi X. Cc: rxtx at qbang.org Subject: Re: [Rxtx] Prolific USB - RXTX data mangled On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From Martin.Oberhuber at windriver.com Wed Apr 23 18:54:26 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 02:54:26 +0200 Subject: [Rxtx] RXTX port locking on Linux status? Message-ID: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Dear RXTX community, I'm wondering what the status is with RXTX locking serial ports on Linux? My understanding is that the mechanism used in 2.1-7r2 (lockfiles) is not really state of the art, and has lots of problems (e.g. missing permissions). There was an idea to migrate towards a Kernel syscall based solution for port locking. What's the status here? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/9878db9f/attachment-0013.html From tjarvi at qbang.org Wed Apr 23 20:32:24 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Apr 2008 20:32:24 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > Dear RXTX community, > > I'm wondering what the status is with RXTX locking > serial ports on Linux? > > My understanding is that the mechanism used in > 2.1-7r2 (lockfiles) is not really state of the art, and > has lots of problems (e.g. missing permissions). > > There was an idea to migrate towards a Kernel > syscall based solution for port locking. > > What's the status here? > Hi Martin, I'm in favor of deprecating the current FHS locking mechanism in favor of an IOCTL when available. I think it will be available on all the platforms but do not know for sure. The status is unchanged. I've had very few free cycles for such things. Feel free to take a stab at it if you have some time. I believe the IOCTL is used in the Mac OS X code already. I don't see any real backwards compatability issues and the IOCTL should just work. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Apr 24 06:14:06 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 14:14:06 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Thanks Trent. Problem is only that I'm really not at all Familiar with the C part of RXTX. If there Were anything I could do in Java for this, It would be easier for me.... ... Are there any C experts here on the list Who'd like to look at ioctl port locking For linux? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Donnerstag, 24. April 2008 04:32 > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > I'm wondering what the status is with RXTX locking > > serial ports on Linux? > > > > My understanding is that the mechanism used in > > 2.1-7r2 (lockfiles) is not really state of the art, and > > has lots of problems (e.g. missing permissions). > > > > There was an idea to migrate towards a Kernel > > syscall based solution for port locking. > > > > What's the status here? > > > > Hi Martin, > > I'm in favor of deprecating the current FHS locking mechanism > in favor of > an IOCTL when available. I think it will be available on all the > platforms but do not know for sure. > > The status is unchanged. I've had very few free cycles for > such things. > Feel free to take a stab at it if you have some time. I > believe the IOCTL > is used in the Mac OS X code already. > > I don't see any real backwards compatability issues and the > IOCTL should > just work. > > -- > Trent Jarvi > tjarvi at qbang.org > From sspies at sloc.de Thu Apr 24 07:15:36 2008 From: sspies at sloc.de (Sebastian Spies) Date: Thu, 24 Apr 2008 15:15:36 +0200 (CEST) Subject: [Rxtx] rxtx on gumstix: Interrupted system call In-Reply-To: <47FB7B20.7080504@sloc.de> References: <47FB7B20.7080504@sloc.de> Message-ID: <55445.130.83.139.205.1209042936.squirrel@ssl.sloc.de> Dear list, while porting rxtx to the gumstix, I found out, that select used in readArray in SerialImp.c might not work as expected. Maybe, because of missing TIOCSERGETLSR-support? select is often interrupted, so i wrote the following quick'n'dirty hack to make it work on gumstix: diff -Nur rxtx-2.1-7r2/src/SerialImp.c rxtx-2.1-7r2/src/SerialImp.c --- rxtx-2.1-7r2/src/SerialImp.c 2006-01-29 23:19:04.000000000 +0100 +++ rxtx-2.1-7r2-patched/src/SerialImp.c 2008-04-24 14:30:17.000000000 +0200 @@ -3380,7 +3381,7 @@ JNIEXPORT jint JNICALL RXTXPort(readArray)( JNIEnv *env, jobject jobj, jbyteArray jbarray, jint offset, jint length ) { - int bytes; + int bytes = 0; jbyte *body; /* char msg[80]; */ int fd = get_java_var( env, jobj, "fd", "I" ); @@ -3397,9 +3398,18 @@ "readArray", "Invalid length" ); return -1; } - body = (*env)->GetByteArrayElements( env, jbarray, 0 ); - bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ - (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + while(1 > bytes) + { + body = (*env)->GetByteArrayElements( env, jbarray, 0 ); + bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ + (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + // quick'n'dirty - SSP + report (" trying again... \n"); + errno = 0; + } + if( bytes < 0 ) { report( "RXTXPort:readArray bytes < 0" ); LEAVE( "RXTXPort:readArray" ); > Hey, > > I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use > RXTXPort$SerialInputStream.read(), then I get the following Exception. I > did not yet figure out which system call is interrupted as strace > produces loads of output. > > Any help would be very appreciated. Thanks in advance. > Sebastian > > > [java] java.io.IOException: Interrupted system call in readArray > [java] at gnu.io.RXTXPort.readArray(Native Method) > [java] at > gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) > [java] at > java.io.FilterInputStream.read(FilterInputStream.java:189) > [java] at > java.io.BufferedInputStream.refill(BufferedInputStream.java:371) > [java] at > java.io.BufferedInputStream.read(BufferedInputStream.java:229) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) > [java] at > com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) > > -- > Sebastian Spies > > mail: sspies at sloc.de > > > > From fire_baptized at hotmail.com Thu Apr 24 18:27:48 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Thu, 24 Apr 2008 20:27:48 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hello I am having a problem with the serial device connecting (software wise) to the serial port. However I have a test program and it seems to work just fine in that environment - and it doesnt use GUI. The error I am getting is : PortNotFoundException Now the way I have it setup in the GUI environment is that once the user pushes a JButton the program connects using this class: protected void establishConnection() { try { portId = CommPortIdentifier.getPortIdentifier("COM3"); System.out.println("Establishing connction....."); messages[0] = "\nEstablishing connction.....\n"; } catch ( NoSuchPortException noport) { System.out.println("Port not found: "+ noport); messages[0] = "Port not found: "+ noport+"\n"; } try { serialPort = (SerialPort) portId.open("serial", 50); System.out.println("Port has been found."); messages[1] = "Port has been found.\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[1] = "" +usedport; } try { serialPort = (SerialPort) portId.open("serial", 50); messages[2] = "Connecting to COM3 on port 50....\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; } try { serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); System.out.println("Esablishing the transfer rate settings for COM3."); messages[3] = "Esablishing the transfer rate settings for COM3.\n"; } catch (UnsupportedCommOperationException nosupcom) { System.out.println(nosupcom); System.out.println("The tranfer rate could not be esblished on COM3."); messages[3] = "The tranfer rate could not be esblished on COM3.\n"; } System.out.println(serialPort.getFlowControlMode()); messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; //sendDataOut(buffer[3],buffer[4]); } I need all the data in this method (and all the string values in this method) to be printed out on a JTextArea. I wont do me any good if not all the text is printed on a JTextArea in another class. So I have the text printing the JTextArea correctly, but everytime the JButton is activated - it gives me that error message. I did add a disconnect button that is supposed to call the serialPort.close(). _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/273fd4ec/attachment-0012.html From tjarvi at qbang.org Thu Apr 24 21:54:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Apr 2008 21:54:10 -0600 (MDT) Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > Hello I am having a problem with the serial device connecting (software > wise) to the serial port. However I have a test program and it seems to > work just fine in that environment - and it doesnt use GUI. The error I > am getting is : PortNotFoundException Now the way I have it setup in the > GUI environment is that once the user pushes a JButton the program > connects using this class: > > protected void establishConnection() { > try { > portId = CommPortIdentifier.getPortIdentifier("COM3"); > System.out.println("Establishing connction....."); > messages[0] = "\nEstablishing connction.....\n"; > } > catch ( NoSuchPortException noport) { > System.out.println("Port not found: "+ noport); > messages[0] = "Port not found: "+ noport+"\n"; > } > try { > serialPort = (SerialPort) portId.open("serial", 50); > System.out.println("Port has been found."); > messages[1] = "Port has been found.\n"; > } > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[1] = "" +usedport; > } ================================================================= > try { > serialPort = (SerialPort) portId.open("serial", 50); > messages[2] = "Connecting to COM3 on port 50....\n"; > } ================================================================== > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > } > try { > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > System.out.println("Esablishing the transfer rate settings for COM3."); > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > } > catch (UnsupportedCommOperationException nosupcom) { > System.out.println(nosupcom); > System.out.println("The tranfer rate could not be esblished on COM3."); > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > } > System.out.println(serialPort.getFlowControlMode()); > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > //sendDataOut(buffer[3],buffer[4]); > } > > I need all the data in this method (and all the string values in this > method) to be printed out on a JTextArea. I wont do me any good if not > all the text is printed on a JTextArea in another class. So I have the > text printing the JTextArea correctly, but everytime the JButton is > activated - it gives me that error message. I did add a disconnect > button that is supposed to call the serialPort.close(). > The open code used twice is going to throw an exception. It may be that you catch the exception above this code and print a confusing message? A common mistake is people will accidently run two copies of their program. The first instance of the program will open the port and prevent enumeration (finding the port) in the second instance of the program. As an example, you may be running your text based application which is preventing the GUI from seeing the port. Enumeration is done by trying to open the port. If the port is open, Enumeration fails. -- Trent Jarvi tjarvi at qbang.org From fire_baptized at hotmail.com Thu Apr 24 22:32:05 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 00:32:05 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Wow - thanks dude what a dumb thing for me to not catch..... now here is the current problem - right now I am trying to output data again one is with the test program - and it seems that serialPort.setRTS(true); is throwing an exceptions there - now if I show this code please bare in mind that I am only testing - the code is kinda sloppy in my mind - but if I can figure out why calling this function is throwing an exception then maybe I can figure out why my GUI application is getting the same null pointer exceptions when try to send out the data stream. FYI Trent this email is not directed towards you - anyone can jump in on this public static void main(String args[]) { byte[] b = new byte[64]; int keyinput = 0 ; byte x = 0; byte y = 0; PortTesting1 testports = new PortTesting1(); try { joyskoro = Joystick.createInstance(); } catch (IOException ioexc) { System.out.println("There is an input/output problem: " + ioexc); } while (true) { joyskoro.poll(); b[0] = ((byte) -(10 * joyskoro.getY())); b[1] = ((byte) (10 * joyskoro.getX())); System.out.println("The 3rd byte is: " +b[0]); System.out.println("The 4rd byte is: " +b[1]); serialPort.setRTS(true); // HERE IS WHERE THE PROBLEM IS !!!!!!! ON THIS LINE but if I dont have it active in my program the Bluetooth device (that is System.out.println("Ready to send :-) !"); //connected to the serial port does not send out data!!!!! if (joyskoro.isButtonDown(joyskoro.BUTTON10)) { System.out.println("Connection terminated."); serialPort.close(); break; } if (joyskoro.isButtonDown(joyskoro.BUTTON2)) { boolean flag = true; //reading from key input from the keyboard System.out.println("Please input a command: "); while (flag) { try { keyinput = System.in.read(); } catch (IOException ioexc) {/*there is no need to put * anything here */ } if((char)keyinput=='w') { pushIt((byte)85); } if((char)keyinput=='s') { pushIt((byte)84); } if((char)keyinput=='a') { pushIt((byte)83); } if((char)keyinput=='d') { pushIt((byte)82); } if((char)keyinput=='q') { pushIt((byte)89); } if((char)keyinput=='\t') { //this stop reading input from the keyboard flag = false; } } and help anyways here is the block of code that throwing an exception for the test program: > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/5c8f7d68/attachment-0012.html From fire_baptized at hotmail.com Fri Apr 25 07:59:53 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 09:59:53 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Are there any examples of how to push out data? As in using input and output streams - if I can compare code maybe I can see where this is causing a problem. I have a byte array that I am pushing out data. I keep getting null pointer exceptions every where I turn. > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/22228ab6/attachment-0011.html From ajmas at sympatico.ca Sat Apr 26 07:37:09 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 26 Apr 2008 09:37:09 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hi, On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote: > > Are there any examples of how to push out data? As in using input > and output streams - if I can compare code maybe I can see where > this is causing a problem. I have a byte array that I am pushing > out data. I keep getting null pointer exceptions every where I turn. > There are some examples here that might be of help: http://rxtx.qbang.org/wiki/index.php/Examples Andre From fire_baptized at hotmail.com Sat Apr 26 20:13:54 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Sat, 26 Apr 2008 22:13:54 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: looked at those....yep didnt help - I need to push out data with GUI and not get a null pointer exception everytime I try. > CC: rxtx at qbang.org> From: ajmas at sympatico.ca> To: fire_baptized at hotmail.com> Subject: Re: [Rxtx] Serial Problems with Gui.....> Date: Sat, 26 Apr 2008 09:37:09 -0400> > Hi,> > > On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote:> >> > Are there any examples of how to push out data? As in using input > > and output streams - if I can compare code maybe I can see where > > this is causing a problem. I have a byte array that I am pushing > > out data. I keep getting null pointer exceptions every where I turn.> >> > There are some examples here that might be of help:> > http://rxtx.qbang.org/wiki/index.php/Examples> > Andre _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080426/09f95b41/attachment-0010.html From michael.erskine at ketech.com Mon Apr 28 02:47:22 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 28 Apr 2008 09:47:22 +0100 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D426EF3CBBC5@no-sv-03.ketech.local> Jesrael D. Summerhill wrote: > looked at those....yep didnt help - I need to push out data with GUI and > not get a null pointer exception everytime I try. So it seems pretty obvious that your code needs to check for nulls wherever one may occur and report what's happening. Alternatively, catch the npe and display the stack trace. Then you can fix your code so it doesn't try to work with something that ain't there. Regards, Michael Erskine. From scldad at sdc.com.au Mon Apr 28 03:58:34 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Mon, 28 Apr 2008 19:28:34 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Message-ID: <200804281928.34454.scldad@sdc.com.au> Has anybody done any design work on this? The first thing that springs to mind is that we still need to check for lock files because other apps tend to use that approach even if we go to ioctl. Cheers, Stephen Davies On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > Thanks Trent. > > Problem is only that I'm really not at all > Familiar with the C part of RXTX. If there > Were anything I could do in Java for this, > It would be easier for me.... > > ... Are there any C experts here on the list > Who'd like to look at ioctl port locking > For linux? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > -----Original Message----- > > From: Trent Jarvi [mailto:tjarvi at qbang.org] > > Sent: Donnerstag, 24. April 2008 04:32 > > To: Oberhuber, Martin > > Cc: rxtx at qbang.org > > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > > > I'm wondering what the status is with RXTX locking > > > serial ports on Linux? > > > > > > My understanding is that the mechanism used in > > > 2.1-7r2 (lockfiles) is not really state of the art, and > > > has lots of problems (e.g. missing permissions). > > > > > > There was an idea to migrate towards a Kernel > > > syscall based solution for port locking. > > > > > > What's the status here? > > > > Hi Martin, > > > > I'm in favor of deprecating the current FHS locking mechanism > > in favor of > > an IOCTL when available. I think it will be available on all the > > platforms but do not know for sure. > > > > The status is unchanged. I've had very few free cycles for > > such things. > > Feel free to take a stab at it if you have some time. I > > believe the IOCTL > > is used in the Mac OS X code already. > > > > I don't see any real backwards compatability issues and the > > IOCTL should > > just work. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Mon Apr 28 04:21:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 28 Apr 2008 04:21:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804281928.34454.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: I don't think there would need to be any architectural changes. A couple ifdefs and minor changes in the current code should be enough. Proposal: FHS/UUCP locks: continue to respect them, try to create them but do not error if the IOCTL is supported. (But does the IOCTL being defined mean it will work?) Enumeration: Do not assert the IOCTL while opening. Serial.open: assert the IOCTL after open. Continue to use locks as described above after asserting the IOCTL. If the IOCTL is defined but not working, handle it here. Failure cases include the IOCTL is not supported and the port is already locked. On Mon, 28 Apr 2008, Stephen Davies wrote: > Has anybody done any design work on this? > The first thing that springs to mind is that we still need to check for lock > files because other apps tend to use that approach even if we go to ioctl. > > Cheers, > Stephen Davies > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: >> Thanks Trent. >> >> Problem is only that I'm really not at all >> Familiar with the C part of RXTX. If there >> Were anything I could do in Java for this, >> It would be easier for me.... >> >> ... Are there any C experts here on the list >> Who'd like to look at ioctl port locking >> For linux? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >>> -----Original Message----- >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] >>> Sent: Donnerstag, 24. April 2008 04:32 >>> To: Oberhuber, Martin >>> Cc: rxtx at qbang.org >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? >>> >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: >>>> Dear RXTX community, >>>> >>>> I'm wondering what the status is with RXTX locking >>>> serial ports on Linux? >>>> >>>> My understanding is that the mechanism used in >>>> 2.1-7r2 (lockfiles) is not really state of the art, and >>>> has lots of problems (e.g. missing permissions). >>>> >>>> There was an idea to migrate towards a Kernel >>>> syscall based solution for port locking. >>>> >>>> What's the status here? >>> >>> Hi Martin, >>> >>> I'm in favor of deprecating the current FHS locking mechanism >>> in favor of >>> an IOCTL when available. I think it will be available on all the >>> platforms but do not know for sure. >>> >>> The status is unchanged. I've had very few free cycles for >>> such things. >>> Feel free to take a stab at it if you have some time. I >>> believe the IOCTL >>> is used in the Mac OS X code already. >>> >>> I don't see any real backwards compatability issues and the >>> IOCTL should >>> just work. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Tue Apr 29 12:04:04 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Apr 2008 20:04:04 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Hi all, The biggest problem that I have seen with lockfiles on Linux At least is, that it seems there is no standard with respect To the folder in which they should be created. Also, many Distributions seem to set up file system permissions in such A way that writing to the lockfile folder is not allowed for The normal user -- that's why we stopped using lockfiles In our commercial product. If we are to still respect lockfiles, we first need to Understand where we are expected to look for them. Does Anybody have any insight what variants of lockfile folder Schema exist out there in the wild? Some apps like minicom Seem to even allow users to manually specify a lockfile Folder of their choice. Because of the difficulty finding the right lockfile folder, And because of the inherent risk of thinking that something Might be locked while it actually isn't, I'd suggest that RXTX should have a "soft-off" feature that allows disabling ALL Lockfile checks at runtime without recompiling the native Sharedlibs. Trent - I like your strategy outline, but I think that it Needs to be configurable by the client such that users and/or Customer Support can disable lockfiles / disable ioctl in Case they detect that they are runing on an OS / Kernal that Does not support one or the other. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Montag, 28. April 2008 12:22 > To: Stephen Davies > Cc: rxtx at qbang.org; Oberhuber, Martin; Trent Jarvi > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > I don't think there would need to be any architectural > changes. A couple > ifdefs and minor changes in the current code should be enough. > > Proposal: > > FHS/UUCP locks: > continue to respect them, try to create them but do not error if > the IOCTL is supported. (But does the IOCTL being defined mean > it will work?) > Enumeration: > Do not assert the IOCTL while opening. > Serial.open: > assert the IOCTL after open. Continue to use locks as described > above after asserting the IOCTL. If the IOCTL is defined but > not working, handle it here. Failure cases include the IOCTL > is not supported and the port is already locked. > > On Mon, 28 Apr 2008, Stephen Davies wrote: > > > Has anybody done any design work on this? > > The first thing that springs to mind is that we still need > to check for lock > > files because other apps tend to use that approach even if > we go to ioctl. > > > > Cheers, > > Stephen Davies > > > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > >> Thanks Trent. > >> > >> Problem is only that I'm really not at all > >> Familiar with the C part of RXTX. If there > >> Were anything I could do in Java for this, > >> It would be easier for me.... > >> > >> ... Are there any C experts here on the list > >> Who'd like to look at ioctl port locking > >> For linux? > >> > >> Thanks, > >> -- > >> Martin Oberhuber, Senior Member of Technical Staff, Wind River > >> Target Management Project Lead, DSDP PMC Member > >> http://www.eclipse.org/dsdp/tm > >> > >>> -----Original Message----- > >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] > >>> Sent: Donnerstag, 24. April 2008 04:32 > >>> To: Oberhuber, Martin > >>> Cc: rxtx at qbang.org > >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? > >>> > >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > >>>> Dear RXTX community, > >>>> > >>>> I'm wondering what the status is with RXTX locking > >>>> serial ports on Linux? > >>>> > >>>> My understanding is that the mechanism used in > >>>> 2.1-7r2 (lockfiles) is not really state of the art, and > >>>> has lots of problems (e.g. missing permissions). > >>>> > >>>> There was an idea to migrate towards a Kernel > >>>> syscall based solution for port locking. > >>>> > >>>> What's the status here? > >>> > >>> Hi Martin, > >>> > >>> I'm in favor of deprecating the current FHS locking mechanism > >>> in favor of > >>> an IOCTL when available. I think it will be available on all the > >>> platforms but do not know for sure. > >>> > >>> The status is unchanged. I've had very few free cycles for > >>> such things. > >>> Feel free to take a stab at it if you have some time. I > >>> believe the IOCTL > >>> is used in the Mac OS X code already. > >>> > >>> I don't see any real backwards compatability issues and the > >>> IOCTL should > >>> just work. > >>> > >>> -- > >>> Trent Jarvi > >>> tjarvi at qbang.org > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > From Steffen.DETTMER at ingenico.com Tue Apr 29 13:34:44 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 29 Apr 2008 21:34:44 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Message-ID: <20080429193444.GU2928@elberon.bln.de.ingenico.com> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > The biggest problem that I have seen with lockfiles on Linux > At least is, that it seems there is no standard with respect > To the folder in which they should be created. Also, many > Distributions seem to set up file system permissions in such > A way that writing to the lockfile folder is not allowed for > The normal user -- that's why we stopped using lockfiles > In our commercial product. It seems it depends on the expectations. I consider it as a feature that by default a linux user cannot access serial ports. Maybe root connected a modem (can produce phone bills) or even some serial card reader, maybe with the web servers key pair. I would expect that by default a user cannot open the serial port because of insufficient permissions on the device file. I would expect this on other unices as well (but I don't know it). For windows I think it should be similar but not impacting so much in practice, because often windows users work with big permissions on a somewhat high priviledge level or even Administrator. > If we are to still respect lockfiles, we first need to > Understand where we are expected to look for them. Does > Anybody have any insight what variants of lockfile folder > Schema exist out there in the wild? Some apps like minicom > Seem to even allow users to manually specify a lockfile > Folder of their choice. At least my (ancient) minicom does not allow the user to change this option, it is displayed but read-only, but root is allowed to change it. > Because of the difficulty finding the right lockfile folder, > And because of the inherent risk of thinking that something > Might be locked while it actually isn't, I'd suggest that > RXTX should have a "soft-off" feature that allows disabling > ALL Lockfile checks at runtime without recompiling the native > Sharedlibs. sounds very reasonable, yes... and as admin I would not wish that users could skip such locking because they do things wrong by default ;) (in the end I guess that is related to the dilemma, that hotplug/user-owned-periphery and multi-user systems simply conflict) > Trent - I like your strategy outline, but I think that it > Needs to be configurable by the client such that users and/or > Customer Support can disable lockfiles / disable ioctl in > Case they detect that they are runing on an OS / Kernal that > Does not support one or the other. Yes, this would be good I guess... Applications could offer configuration options to control that, maybe similarily as minicom. BTW, man minicom tells: *B - Lock file location On most systems This should be /usr/spool/uucp. Linux systems use /var/lock. If this directory does not exist, minicom will not attempt to use lockfiles. The statement `Linux systems use /var/lock' is interesting, does anyone know the source of this convention? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Tue Apr 29 16:11:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Apr 2008 16:11:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? These details are outlined in the Filesystem Hierarchy Standard (FHS). http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLOCKLOCKFILES -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Tue Apr 29 18:58:09 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Wed, 30 Apr 2008 10:28:09 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: <200804301028.09307.scldad@sdc.com.au> I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is the same. Any ideas as to how to handle this? Stephen On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: > * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > > The biggest problem that I have seen with lockfiles on Linux > > At least is, that it seems there is no standard with respect > > To the folder in which they should be created. Also, many > > Distributions seem to set up file system permissions in such > > A way that writing to the lockfile folder is not allowed for > > The normal user -- that's why we stopped using lockfiles > > In our commercial product. > > It seems it depends on the expectations. I consider it as a > feature that by default a linux user cannot access serial ports. > Maybe root connected a modem (can produce phone bills) or even > some serial card reader, maybe with the web servers key pair. > > I would expect that by default a user cannot open the serial port > because of insufficient permissions on the device file. I would > expect this on other unices as well (but I don't know it). > > For windows I think it should be similar but not impacting so > much in practice, because often windows users work with big > permissions on a somewhat high priviledge level or even > Administrator. > > > If we are to still respect lockfiles, we first need to > > Understand where we are expected to look for them. Does > > Anybody have any insight what variants of lockfile folder > > Schema exist out there in the wild? Some apps like minicom > > Seem to even allow users to manually specify a lockfile > > Folder of their choice. > > At least my (ancient) minicom does not allow the user to change > this option, it is displayed but read-only, but root is allowed > to change it. > > > Because of the difficulty finding the right lockfile folder, > > And because of the inherent risk of thinking that something > > Might be locked while it actually isn't, I'd suggest that > > RXTX should have a "soft-off" feature that allows disabling > > ALL Lockfile checks at runtime without recompiling the native > > Sharedlibs. > > sounds very reasonable, yes... > and as admin I would not wish that users could skip such > locking because they do things wrong by default ;) > > (in the end I guess that is related to the dilemma, that > hotplug/user-owned-periphery and multi-user systems simply > conflict) > > > Trent - I like your strategy outline, but I think that it > > Needs to be configurable by the client such that users and/or > > Customer Support can disable lockfiles / disable ioctl in > > Case they detect that they are runing on an OS / Kernal that > > Does not support one or the other. > > Yes, this would be good I guess... Applications could offer > configuration options to control that, maybe similarily as > minicom. > > BTW, man minicom tells: > > *B - Lock file location > On most systems This should be /usr/spool/uucp. > Linux systems use /var/lock. If this directory > does not exist, minicom will not attempt to use > lockfiles. > > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure > and expedient electronic transaction acceptance. Ingenico products leverage > proven technology, established standards and unparalleled ergonomics to > provide optimal reliability, versatility and usability. This comprehensive > range of products is complemented by a global array of services and > partnerships, enabling businesses in a number of vertical sectors to accept > transactions anywhere their business takes them. www.ingenico.com This > message may contain confidential and/or privileged information. If you are > not the addressee or authorized to receive this for the addressee, you must > not use, copy, disclose or take any action based on this message or any > information herein. If you have received this message in error, please > advise the sender immediately by reply e-mail and delete this message. > Thank you for your cooperation. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Wed Apr 30 19:30:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 30 Apr 2008 19:30:51 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804301028.09307.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> <200804301028.09307.scldad@sdc.com.au> Message-ID: Hi Stephen, I suspect ioctl/TIOCEXCL open/O_EXCL would do the job. Mac uses TIOCEXCL and it is POSIX. We use O_EXCL for lockfiles on Linux already. On Wed, 30 Apr 2008, Stephen Davies wrote: > I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is > the same. > > Any ideas as to how to handle this? > > Stephen > > > On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: >> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: >>> The biggest problem that I have seen with lockfiles on Linux >>> At least is, that it seems there is no standard with respect >>> To the folder in which they should be created. Also, many >>> Distributions seem to set up file system permissions in such >>> A way that writing to the lockfile folder is not allowed for >>> The normal user -- that's why we stopped using lockfiles >>> In our commercial product. >> >> It seems it depends on the expectations. I consider it as a >> feature that by default a linux user cannot access serial ports. >> Maybe root connected a modem (can produce phone bills) or even >> some serial card reader, maybe with the web servers key pair. >> >> I would expect that by default a user cannot open the serial port >> because of insufficient permissions on the device file. I would >> expect this on other unices as well (but I don't know it). >> >> For windows I think it should be similar but not impacting so >> much in practice, because often windows users work with big >> permissions on a somewhat high priviledge level or even >> Administrator. >> >>> If we are to still respect lockfiles, we first need to >>> Understand where we are expected to look for them. Does >>> Anybody have any insight what variants of lockfile folder >>> Schema exist out there in the wild? Some apps like minicom >>> Seem to even allow users to manually specify a lockfile >>> Folder of their choice. >> >> At least my (ancient) minicom does not allow the user to change >> this option, it is displayed but read-only, but root is allowed >> to change it. >> >>> Because of the difficulty finding the right lockfile folder, >>> And because of the inherent risk of thinking that something >>> Might be locked while it actually isn't, I'd suggest that >>> RXTX should have a "soft-off" feature that allows disabling >>> ALL Lockfile checks at runtime without recompiling the native >>> Sharedlibs. >> >> sounds very reasonable, yes... >> and as admin I would not wish that users could skip such >> locking because they do things wrong by default ;) >> >> (in the end I guess that is related to the dilemma, that >> hotplug/user-owned-periphery and multi-user systems simply >> conflict) >> >>> Trent - I like your strategy outline, but I think that it >>> Needs to be configurable by the client such that users and/or >>> Customer Support can disable lockfiles / disable ioctl in >>> Case they detect that they are runing on an OS / Kernal that >>> Does not support one or the other. >> >> Yes, this would be good I guess... Applications could offer >> configuration options to control that, maybe similarily as >> minicom. >> >> BTW, man minicom tells: >> >> *B - Lock file location >> On most systems This should be /usr/spool/uucp. >> Linux systems use /var/lock. If this directory >> does not exist, minicom will not attempt to use >> lockfiles. >> >> The statement `Linux systems use /var/lock' is interesting, does >> anyone know the source of this convention? >> >> oki, >> >> Steffen >> >> About Ingenico Throughout the world businesses rely on Ingenico for secure >> and expedient electronic transaction acceptance. Ingenico products leverage >> proven technology, established standards and unparalleled ergonomics to >> provide optimal reliability, versatility and usability. This comprehensive >> range of products is complemented by a global array of services and >> partnerships, enabling businesses in a number of vertical sectors to accept >> transactions anywhere their business takes them. www.ingenico.com This >> message may contain confidential and/or privileged information. If you are >> not the addressee or authorized to receive this for the addressee, you must >> not use, copy, disclose or take any action based on this message or any >> information herein. If you have received this message in error, please >> advise the sender immediately by reply e-mail and delete this message. >> Thank you for your cooperation. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0036.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0034.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0021.html From pboulton at pulsetracer.com Fri Apr 18 14:30:13 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Fri, 18 Apr 2008 13:30:13 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site Message-ID: <480904D5.1060307@pulsetracer.com> Hello, gentle serial porters. I have downloaded the zipped up binaries for use on Windows without Sun's CommAPI, but don't seem able to extract anything from the download. Go to main page, http://www.rxtx.org/ Click on Downloads I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) And I save it to disk. If I try and extract the files with WinZip, Winzip thinks the archive is corrupt. If I try using Windows Explorer, I am able to extract it into a single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than the original .zip. Any help would be much appreciated. Sincerely, Philip Boulton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080418/97d89793/attachment-0019.html From tjarvi at qbang.org Fri Apr 18 19:07:00 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 18 Apr 2008 19:07:00 -0600 (MDT) Subject: [Rxtx] Difficulty opening zip file at rxtx site In-Reply-To: <480904D5.1060307@pulsetracer.com> References: <480904D5.1060307@pulsetracer.com> Message-ID: On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org From pboulton at pulsetracer.com Sat Apr 19 12:46:26 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Sat, 19 Apr 2008 11:46:26 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site References: <480904D5.1060307@pulsetracer.com> Message-ID: <53DB7576450695419E09299104043761A78533@ZTGSERVER.ztg.local> I have been able to get my hands on the binaries, by going to the ftp directory /pub/rxtx at ftp.qbang.org,, and ftping the file rxtx-2.1-7-bins-r2.zip . This opens happily with Winzip, and extracts as the set of files that you describe below. I only experience the ill-formed archive problem by clicking the link on the rxtx.org Downloads page (http://rxtx.qbang.org/pub/rxtx/ rxtx-2.1-7-bins-r2.zip ). Not sure what to make of that. Philip Boulton ________________________________ From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Fri 4/18/2008 6:07 PM To: Philip Boulton Cc: rxtx at qbang.org Subject: Re: [Rxtx] Difficulty opening zip file at rxtx site On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080419/147923bb/attachment-0018.html From jlar310 at gmail.com Sat Apr 19 19:11:55 2008 From: jlar310 at gmail.com (Jeff Larsen) Date: Sat, 19 Apr 2008 20:11:55 -0500 Subject: [Rxtx] Moxa serial over Ethernet driver Message-ID: Hi all, I've been using javax.comm for years to communicate with a legacy radio data system. We want to migrate the java side of the system to a VMware Server virtual machine. We've had great success using Moxa DE-303 and 5610 serial over Ethernet appliances and virtual machines for running hylafax. The OS (Linux in this case) uses a kernel driver to communicate with the Moxa via a virtual serial port such as /dev/ttyr00. I want to do the same thing with javax.comm or gnu.io to connect to a virtual serial port. However I'm hitting road blocks everywhere. javax.comm for Linux sees the virtual port, but there are transmission errors. Tried Solaris too, but the Solaris Moxa drivers don't play nice with javax.comm because the driver uses /dev/pts/n instead of /dev/term/x. Next I tried RXTX on Linux, but I'm getting NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX on Solaris. Has anyone used RXTX with serial over Ethernet devices? Any hints on how to make it work? I know that I'm not completely off track because javax.comm does work with Moxa on a Windows platform, but that's just not an option for production deployment. -- Jeff From tjarvi at qbang.org Sat Apr 19 21:08:41 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 19 Apr 2008 21:08:41 -0600 (MDT) Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: yOn Sat, 19 Apr 2008, Jeff Larsen wrote: > Hi all, > > I've been using javax.comm for years to communicate with a legacy > radio data system. We want to migrate the java side of the system to a > VMware Server virtual machine. We've had great success using Moxa > DE-303 and 5610 serial over Ethernet appliances and virtual machines > for running hylafax. The OS (Linux in this case) uses a kernel driver > to communicate with the Moxa via a virtual serial port such as > /dev/ttyr00. > > I want to do the same thing with javax.comm or gnu.io to connect to a > virtual serial port. However I'm hitting road blocks everywhere. > javax.comm for Linux sees the virtual port, but there are transmission > errors. Tried Solaris too, but the Solaris Moxa drivers don't play > nice with javax.comm because the driver uses /dev/pts/n instead of > /dev/term/x. Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris. > > Has anyone used RXTX with serial over Ethernet devices? Any hints on > how to make it work? > > I know that I'm not completely off track because javax.comm does work > with Moxa on a Windows platform, but that's just not an option for > production deployment. > > Moxa should work under linux. There may be minor issues depending upon how complete the kernel driver is but I think it will work. One of the minor issues is /dev/ttyr00 is not enumerated. There are several work arounds documented with the source code and on the wiki. The easiest solution for testing purposes is to make a symbolic link from /dev/ttyr00 to a port that is enumerated such as /dev/ttyS129. You can later alter the rxtx source or use properties to change the enumerated ports. -- Trent Jarvi tjarvi at qbang.org From d.tonhofer at m-plify.com Sun Apr 20 03:33:30 2008 From: d.tonhofer at m-plify.com (David Tonhofer (M-PLIFY S.A.)) Date: Sun, 20 Apr 2008 11:33:30 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: <480B0DEA.5010908@m-plify.com> Jeff Larsen wrote: > Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris It might be that the Java side of RXTX does not recognize that portname. Trying modifying src/RXTXCommDriver.java as described in this case: http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card From ajmas at sympatico.ca Sun Apr 20 16:37:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Apr 2008 18:37:59 -0400 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <480B0DEA.5010908@m-plify.com> References: <480B0DEA.5010908@m-plify.com> Message-ID: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > Jeff Larsen wrote: >> Next I tried RXTX on Linux, but I'm getting >> NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX >> on Solaris > It might be that the Java side of RXTX does not recognize that > portname. > Trying modifying src/RXTXCommDriver.java as described in this case: > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card I wonder whether it would be worth allowing custom port prefixes as a system parameter? For example: gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" Andre From Martin.Oberhuber at windriver.com Tue Apr 22 12:34:36 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 22 Apr 2008 20:34:36 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> References: <480B0DEA.5010908@m-plify.com> <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE6485848056CD6CE@ism-mail03.corp.ad.wrs.com> Sounds like a great idea... I'm wondering how the "variable part" after the Prefixes could be specified though? What about allowing Regular Expression character Classes in the existing System Property for specifying ports: System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyS[0-9],ttyS[ABC],ttyUSB[0-9a-z]"); The set of allowed patterns would of course need to Be restricted compared to REGEX, because it must be A syntax that supports iterating over it. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Montag, 21. April 2008 00:38 > To: rxtx at qbang.org and Users > Subject: Re: [Rxtx] Moxa serial over Ethernet driver > > > On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > > Jeff Larsen wrote: > >> Next I tried RXTX on Linux, but I'm getting > >> NoSuchPortException connecting to /dev/ttyr00. I have yet > to try RXTX > >> on Solaris > > It might be that the Java side of RXTX does not recognize that > > portname. > > Trying modifying src/RXTXCommDriver.java as described in this case: > > > > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_ > SST-4P.2FLP_multiport_card > > I wonder whether it would be worth allowing custom port > prefixes as a > system parameter? For > example: > > gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Loi.TRAN at weatherford.com Tue Apr 22 13:10:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Tue, 22 Apr 2008 14:10:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled Message-ID: Hi, I'm currently using the Java RXTX API to interface to a serial port. The serial port is connected to a bridge board that communicates with our communications system running at 1.875 Mbps which is linked to an embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no flow control). I send a command to the embedded board through the serial-bridge board which then is relayed to the embedded board. The command sent asks the embedded board to dump a binary image. Here's where I'm hitting some problems. I've successfully done this is an integrated serial port from the laptop. The binary file that comes back is consistent on every attempt. When I use the application I've written to do the same thing with a USB-to-serial adapter, the image I get back is not the same as the image I receive through the USB-to-serial adapter is not consistent at all. A final thing is that when I use a terminal program to dump the binary image with the USB-serial adapter, the image is correct. Every time! What is the terminal program doing that's not being done in my application? My application is quite simple. Has anyone observed this behavior before? If you have, I'd like to know how you've gotten around this problem. Thanks, LT =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From tjarvi at qbang.org Tue Apr 22 21:11:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 22 Apr 2008 21:11:10 -0600 (MDT) Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org From Loi.TRAN at weatherford.com Wed Apr 23 08:35:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Wed, 23 Apr 2008 09:35:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: Thanks for all the responses. I finally tried something that worked consistently. I updated my Prolific driver and repeated my tests. It worked. If you're using the Prolific type USB-serial adapters, do no use the Prolific version 2.0.2.1 driver on Windows. Update it to the latest 2.0.2.8 version. Again, thanks for all the responses. LT -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Tuesday, April 22, 2008 10:11 PM To: TRAN, Loi X. Cc: rxtx at qbang.org Subject: Re: [Rxtx] Prolific USB - RXTX data mangled On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From Martin.Oberhuber at windriver.com Wed Apr 23 18:54:26 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 02:54:26 +0200 Subject: [Rxtx] RXTX port locking on Linux status? Message-ID: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Dear RXTX community, I'm wondering what the status is with RXTX locking serial ports on Linux? My understanding is that the mechanism used in 2.1-7r2 (lockfiles) is not really state of the art, and has lots of problems (e.g. missing permissions). There was an idea to migrate towards a Kernel syscall based solution for port locking. What's the status here? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/9878db9f/attachment-0014.html From tjarvi at qbang.org Wed Apr 23 20:32:24 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Apr 2008 20:32:24 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > Dear RXTX community, > > I'm wondering what the status is with RXTX locking > serial ports on Linux? > > My understanding is that the mechanism used in > 2.1-7r2 (lockfiles) is not really state of the art, and > has lots of problems (e.g. missing permissions). > > There was an idea to migrate towards a Kernel > syscall based solution for port locking. > > What's the status here? > Hi Martin, I'm in favor of deprecating the current FHS locking mechanism in favor of an IOCTL when available. I think it will be available on all the platforms but do not know for sure. The status is unchanged. I've had very few free cycles for such things. Feel free to take a stab at it if you have some time. I believe the IOCTL is used in the Mac OS X code already. I don't see any real backwards compatability issues and the IOCTL should just work. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Apr 24 06:14:06 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 14:14:06 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Thanks Trent. Problem is only that I'm really not at all Familiar with the C part of RXTX. If there Were anything I could do in Java for this, It would be easier for me.... ... Are there any C experts here on the list Who'd like to look at ioctl port locking For linux? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Donnerstag, 24. April 2008 04:32 > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > I'm wondering what the status is with RXTX locking > > serial ports on Linux? > > > > My understanding is that the mechanism used in > > 2.1-7r2 (lockfiles) is not really state of the art, and > > has lots of problems (e.g. missing permissions). > > > > There was an idea to migrate towards a Kernel > > syscall based solution for port locking. > > > > What's the status here? > > > > Hi Martin, > > I'm in favor of deprecating the current FHS locking mechanism > in favor of > an IOCTL when available. I think it will be available on all the > platforms but do not know for sure. > > The status is unchanged. I've had very few free cycles for > such things. > Feel free to take a stab at it if you have some time. I > believe the IOCTL > is used in the Mac OS X code already. > > I don't see any real backwards compatability issues and the > IOCTL should > just work. > > -- > Trent Jarvi > tjarvi at qbang.org > From sspies at sloc.de Thu Apr 24 07:15:36 2008 From: sspies at sloc.de (Sebastian Spies) Date: Thu, 24 Apr 2008 15:15:36 +0200 (CEST) Subject: [Rxtx] rxtx on gumstix: Interrupted system call In-Reply-To: <47FB7B20.7080504@sloc.de> References: <47FB7B20.7080504@sloc.de> Message-ID: <55445.130.83.139.205.1209042936.squirrel@ssl.sloc.de> Dear list, while porting rxtx to the gumstix, I found out, that select used in readArray in SerialImp.c might not work as expected. Maybe, because of missing TIOCSERGETLSR-support? select is often interrupted, so i wrote the following quick'n'dirty hack to make it work on gumstix: diff -Nur rxtx-2.1-7r2/src/SerialImp.c rxtx-2.1-7r2/src/SerialImp.c --- rxtx-2.1-7r2/src/SerialImp.c 2006-01-29 23:19:04.000000000 +0100 +++ rxtx-2.1-7r2-patched/src/SerialImp.c 2008-04-24 14:30:17.000000000 +0200 @@ -3380,7 +3381,7 @@ JNIEXPORT jint JNICALL RXTXPort(readArray)( JNIEnv *env, jobject jobj, jbyteArray jbarray, jint offset, jint length ) { - int bytes; + int bytes = 0; jbyte *body; /* char msg[80]; */ int fd = get_java_var( env, jobj, "fd", "I" ); @@ -3397,9 +3398,18 @@ "readArray", "Invalid length" ); return -1; } - body = (*env)->GetByteArrayElements( env, jbarray, 0 ); - bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ - (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + while(1 > bytes) + { + body = (*env)->GetByteArrayElements( env, jbarray, 0 ); + bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ + (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + // quick'n'dirty - SSP + report (" trying again... \n"); + errno = 0; + } + if( bytes < 0 ) { report( "RXTXPort:readArray bytes < 0" ); LEAVE( "RXTXPort:readArray" ); > Hey, > > I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use > RXTXPort$SerialInputStream.read(), then I get the following Exception. I > did not yet figure out which system call is interrupted as strace > produces loads of output. > > Any help would be very appreciated. Thanks in advance. > Sebastian > > > [java] java.io.IOException: Interrupted system call in readArray > [java] at gnu.io.RXTXPort.readArray(Native Method) > [java] at > gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) > [java] at > java.io.FilterInputStream.read(FilterInputStream.java:189) > [java] at > java.io.BufferedInputStream.refill(BufferedInputStream.java:371) > [java] at > java.io.BufferedInputStream.read(BufferedInputStream.java:229) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) > [java] at > com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) > > -- > Sebastian Spies > > mail: sspies at sloc.de > > > > From fire_baptized at hotmail.com Thu Apr 24 18:27:48 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Thu, 24 Apr 2008 20:27:48 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hello I am having a problem with the serial device connecting (software wise) to the serial port. However I have a test program and it seems to work just fine in that environment - and it doesnt use GUI. The error I am getting is : PortNotFoundException Now the way I have it setup in the GUI environment is that once the user pushes a JButton the program connects using this class: protected void establishConnection() { try { portId = CommPortIdentifier.getPortIdentifier("COM3"); System.out.println("Establishing connction....."); messages[0] = "\nEstablishing connction.....\n"; } catch ( NoSuchPortException noport) { System.out.println("Port not found: "+ noport); messages[0] = "Port not found: "+ noport+"\n"; } try { serialPort = (SerialPort) portId.open("serial", 50); System.out.println("Port has been found."); messages[1] = "Port has been found.\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[1] = "" +usedport; } try { serialPort = (SerialPort) portId.open("serial", 50); messages[2] = "Connecting to COM3 on port 50....\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; } try { serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); System.out.println("Esablishing the transfer rate settings for COM3."); messages[3] = "Esablishing the transfer rate settings for COM3.\n"; } catch (UnsupportedCommOperationException nosupcom) { System.out.println(nosupcom); System.out.println("The tranfer rate could not be esblished on COM3."); messages[3] = "The tranfer rate could not be esblished on COM3.\n"; } System.out.println(serialPort.getFlowControlMode()); messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; //sendDataOut(buffer[3],buffer[4]); } I need all the data in this method (and all the string values in this method) to be printed out on a JTextArea. I wont do me any good if not all the text is printed on a JTextArea in another class. So I have the text printing the JTextArea correctly, but everytime the JButton is activated - it gives me that error message. I did add a disconnect button that is supposed to call the serialPort.close(). _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/273fd4ec/attachment-0013.html From tjarvi at qbang.org Thu Apr 24 21:54:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Apr 2008 21:54:10 -0600 (MDT) Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > Hello I am having a problem with the serial device connecting (software > wise) to the serial port. However I have a test program and it seems to > work just fine in that environment - and it doesnt use GUI. The error I > am getting is : PortNotFoundException Now the way I have it setup in the > GUI environment is that once the user pushes a JButton the program > connects using this class: > > protected void establishConnection() { > try { > portId = CommPortIdentifier.getPortIdentifier("COM3"); > System.out.println("Establishing connction....."); > messages[0] = "\nEstablishing connction.....\n"; > } > catch ( NoSuchPortException noport) { > System.out.println("Port not found: "+ noport); > messages[0] = "Port not found: "+ noport+"\n"; > } > try { > serialPort = (SerialPort) portId.open("serial", 50); > System.out.println("Port has been found."); > messages[1] = "Port has been found.\n"; > } > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[1] = "" +usedport; > } ================================================================= > try { > serialPort = (SerialPort) portId.open("serial", 50); > messages[2] = "Connecting to COM3 on port 50....\n"; > } ================================================================== > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > } > try { > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > System.out.println("Esablishing the transfer rate settings for COM3."); > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > } > catch (UnsupportedCommOperationException nosupcom) { > System.out.println(nosupcom); > System.out.println("The tranfer rate could not be esblished on COM3."); > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > } > System.out.println(serialPort.getFlowControlMode()); > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > //sendDataOut(buffer[3],buffer[4]); > } > > I need all the data in this method (and all the string values in this > method) to be printed out on a JTextArea. I wont do me any good if not > all the text is printed on a JTextArea in another class. So I have the > text printing the JTextArea correctly, but everytime the JButton is > activated - it gives me that error message. I did add a disconnect > button that is supposed to call the serialPort.close(). > The open code used twice is going to throw an exception. It may be that you catch the exception above this code and print a confusing message? A common mistake is people will accidently run two copies of their program. The first instance of the program will open the port and prevent enumeration (finding the port) in the second instance of the program. As an example, you may be running your text based application which is preventing the GUI from seeing the port. Enumeration is done by trying to open the port. If the port is open, Enumeration fails. -- Trent Jarvi tjarvi at qbang.org From fire_baptized at hotmail.com Thu Apr 24 22:32:05 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 00:32:05 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Wow - thanks dude what a dumb thing for me to not catch..... now here is the current problem - right now I am trying to output data again one is with the test program - and it seems that serialPort.setRTS(true); is throwing an exceptions there - now if I show this code please bare in mind that I am only testing - the code is kinda sloppy in my mind - but if I can figure out why calling this function is throwing an exception then maybe I can figure out why my GUI application is getting the same null pointer exceptions when try to send out the data stream. FYI Trent this email is not directed towards you - anyone can jump in on this public static void main(String args[]) { byte[] b = new byte[64]; int keyinput = 0 ; byte x = 0; byte y = 0; PortTesting1 testports = new PortTesting1(); try { joyskoro = Joystick.createInstance(); } catch (IOException ioexc) { System.out.println("There is an input/output problem: " + ioexc); } while (true) { joyskoro.poll(); b[0] = ((byte) -(10 * joyskoro.getY())); b[1] = ((byte) (10 * joyskoro.getX())); System.out.println("The 3rd byte is: " +b[0]); System.out.println("The 4rd byte is: " +b[1]); serialPort.setRTS(true); // HERE IS WHERE THE PROBLEM IS !!!!!!! ON THIS LINE but if I dont have it active in my program the Bluetooth device (that is System.out.println("Ready to send :-) !"); //connected to the serial port does not send out data!!!!! if (joyskoro.isButtonDown(joyskoro.BUTTON10)) { System.out.println("Connection terminated."); serialPort.close(); break; } if (joyskoro.isButtonDown(joyskoro.BUTTON2)) { boolean flag = true; //reading from key input from the keyboard System.out.println("Please input a command: "); while (flag) { try { keyinput = System.in.read(); } catch (IOException ioexc) {/*there is no need to put * anything here */ } if((char)keyinput=='w') { pushIt((byte)85); } if((char)keyinput=='s') { pushIt((byte)84); } if((char)keyinput=='a') { pushIt((byte)83); } if((char)keyinput=='d') { pushIt((byte)82); } if((char)keyinput=='q') { pushIt((byte)89); } if((char)keyinput=='\t') { //this stop reading input from the keyboard flag = false; } } and help anyways here is the block of code that throwing an exception for the test program: > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/5c8f7d68/attachment-0013.html From fire_baptized at hotmail.com Fri Apr 25 07:59:53 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 09:59:53 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Are there any examples of how to push out data? As in using input and output streams - if I can compare code maybe I can see where this is causing a problem. I have a byte array that I am pushing out data. I keep getting null pointer exceptions every where I turn. > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/22228ab6/attachment-0012.html From ajmas at sympatico.ca Sat Apr 26 07:37:09 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 26 Apr 2008 09:37:09 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hi, On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote: > > Are there any examples of how to push out data? As in using input > and output streams - if I can compare code maybe I can see where > this is causing a problem. I have a byte array that I am pushing > out data. I keep getting null pointer exceptions every where I turn. > There are some examples here that might be of help: http://rxtx.qbang.org/wiki/index.php/Examples Andre From fire_baptized at hotmail.com Sat Apr 26 20:13:54 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Sat, 26 Apr 2008 22:13:54 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: looked at those....yep didnt help - I need to push out data with GUI and not get a null pointer exception everytime I try. > CC: rxtx at qbang.org> From: ajmas at sympatico.ca> To: fire_baptized at hotmail.com> Subject: Re: [Rxtx] Serial Problems with Gui.....> Date: Sat, 26 Apr 2008 09:37:09 -0400> > Hi,> > > On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote:> >> > Are there any examples of how to push out data? As in using input > > and output streams - if I can compare code maybe I can see where > > this is causing a problem. I have a byte array that I am pushing > > out data. I keep getting null pointer exceptions every where I turn.> >> > There are some examples here that might be of help:> > http://rxtx.qbang.org/wiki/index.php/Examples> > Andre _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080426/09f95b41/attachment-0011.html From michael.erskine at ketech.com Mon Apr 28 02:47:22 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 28 Apr 2008 09:47:22 +0100 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D426EF3CBBC5@no-sv-03.ketech.local> Jesrael D. Summerhill wrote: > looked at those....yep didnt help - I need to push out data with GUI and > not get a null pointer exception everytime I try. So it seems pretty obvious that your code needs to check for nulls wherever one may occur and report what's happening. Alternatively, catch the npe and display the stack trace. Then you can fix your code so it doesn't try to work with something that ain't there. Regards, Michael Erskine. From scldad at sdc.com.au Mon Apr 28 03:58:34 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Mon, 28 Apr 2008 19:28:34 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Message-ID: <200804281928.34454.scldad@sdc.com.au> Has anybody done any design work on this? The first thing that springs to mind is that we still need to check for lock files because other apps tend to use that approach even if we go to ioctl. Cheers, Stephen Davies On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > Thanks Trent. > > Problem is only that I'm really not at all > Familiar with the C part of RXTX. If there > Were anything I could do in Java for this, > It would be easier for me.... > > ... Are there any C experts here on the list > Who'd like to look at ioctl port locking > For linux? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > -----Original Message----- > > From: Trent Jarvi [mailto:tjarvi at qbang.org] > > Sent: Donnerstag, 24. April 2008 04:32 > > To: Oberhuber, Martin > > Cc: rxtx at qbang.org > > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > > > I'm wondering what the status is with RXTX locking > > > serial ports on Linux? > > > > > > My understanding is that the mechanism used in > > > 2.1-7r2 (lockfiles) is not really state of the art, and > > > has lots of problems (e.g. missing permissions). > > > > > > There was an idea to migrate towards a Kernel > > > syscall based solution for port locking. > > > > > > What's the status here? > > > > Hi Martin, > > > > I'm in favor of deprecating the current FHS locking mechanism > > in favor of > > an IOCTL when available. I think it will be available on all the > > platforms but do not know for sure. > > > > The status is unchanged. I've had very few free cycles for > > such things. > > Feel free to take a stab at it if you have some time. I > > believe the IOCTL > > is used in the Mac OS X code already. > > > > I don't see any real backwards compatability issues and the > > IOCTL should > > just work. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Mon Apr 28 04:21:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 28 Apr 2008 04:21:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804281928.34454.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: I don't think there would need to be any architectural changes. A couple ifdefs and minor changes in the current code should be enough. Proposal: FHS/UUCP locks: continue to respect them, try to create them but do not error if the IOCTL is supported. (But does the IOCTL being defined mean it will work?) Enumeration: Do not assert the IOCTL while opening. Serial.open: assert the IOCTL after open. Continue to use locks as described above after asserting the IOCTL. If the IOCTL is defined but not working, handle it here. Failure cases include the IOCTL is not supported and the port is already locked. On Mon, 28 Apr 2008, Stephen Davies wrote: > Has anybody done any design work on this? > The first thing that springs to mind is that we still need to check for lock > files because other apps tend to use that approach even if we go to ioctl. > > Cheers, > Stephen Davies > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: >> Thanks Trent. >> >> Problem is only that I'm really not at all >> Familiar with the C part of RXTX. If there >> Were anything I could do in Java for this, >> It would be easier for me.... >> >> ... Are there any C experts here on the list >> Who'd like to look at ioctl port locking >> For linux? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >>> -----Original Message----- >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] >>> Sent: Donnerstag, 24. April 2008 04:32 >>> To: Oberhuber, Martin >>> Cc: rxtx at qbang.org >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? >>> >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: >>>> Dear RXTX community, >>>> >>>> I'm wondering what the status is with RXTX locking >>>> serial ports on Linux? >>>> >>>> My understanding is that the mechanism used in >>>> 2.1-7r2 (lockfiles) is not really state of the art, and >>>> has lots of problems (e.g. missing permissions). >>>> >>>> There was an idea to migrate towards a Kernel >>>> syscall based solution for port locking. >>>> >>>> What's the status here? >>> >>> Hi Martin, >>> >>> I'm in favor of deprecating the current FHS locking mechanism >>> in favor of >>> an IOCTL when available. I think it will be available on all the >>> platforms but do not know for sure. >>> >>> The status is unchanged. I've had very few free cycles for >>> such things. >>> Feel free to take a stab at it if you have some time. I >>> believe the IOCTL >>> is used in the Mac OS X code already. >>> >>> I don't see any real backwards compatability issues and the >>> IOCTL should >>> just work. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Tue Apr 29 12:04:04 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Apr 2008 20:04:04 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Hi all, The biggest problem that I have seen with lockfiles on Linux At least is, that it seems there is no standard with respect To the folder in which they should be created. Also, many Distributions seem to set up file system permissions in such A way that writing to the lockfile folder is not allowed for The normal user -- that's why we stopped using lockfiles In our commercial product. If we are to still respect lockfiles, we first need to Understand where we are expected to look for them. Does Anybody have any insight what variants of lockfile folder Schema exist out there in the wild? Some apps like minicom Seem to even allow users to manually specify a lockfile Folder of their choice. Because of the difficulty finding the right lockfile folder, And because of the inherent risk of thinking that something Might be locked while it actually isn't, I'd suggest that RXTX should have a "soft-off" feature that allows disabling ALL Lockfile checks at runtime without recompiling the native Sharedlibs. Trent - I like your strategy outline, but I think that it Needs to be configurable by the client such that users and/or Customer Support can disable lockfiles / disable ioctl in Case they detect that they are runing on an OS / Kernal that Does not support one or the other. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Montag, 28. April 2008 12:22 > To: Stephen Davies > Cc: rxtx at qbang.org; Oberhuber, Martin; Trent Jarvi > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > I don't think there would need to be any architectural > changes. A couple > ifdefs and minor changes in the current code should be enough. > > Proposal: > > FHS/UUCP locks: > continue to respect them, try to create them but do not error if > the IOCTL is supported. (But does the IOCTL being defined mean > it will work?) > Enumeration: > Do not assert the IOCTL while opening. > Serial.open: > assert the IOCTL after open. Continue to use locks as described > above after asserting the IOCTL. If the IOCTL is defined but > not working, handle it here. Failure cases include the IOCTL > is not supported and the port is already locked. > > On Mon, 28 Apr 2008, Stephen Davies wrote: > > > Has anybody done any design work on this? > > The first thing that springs to mind is that we still need > to check for lock > > files because other apps tend to use that approach even if > we go to ioctl. > > > > Cheers, > > Stephen Davies > > > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > >> Thanks Trent. > >> > >> Problem is only that I'm really not at all > >> Familiar with the C part of RXTX. If there > >> Were anything I could do in Java for this, > >> It would be easier for me.... > >> > >> ... Are there any C experts here on the list > >> Who'd like to look at ioctl port locking > >> For linux? > >> > >> Thanks, > >> -- > >> Martin Oberhuber, Senior Member of Technical Staff, Wind River > >> Target Management Project Lead, DSDP PMC Member > >> http://www.eclipse.org/dsdp/tm > >> > >>> -----Original Message----- > >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] > >>> Sent: Donnerstag, 24. April 2008 04:32 > >>> To: Oberhuber, Martin > >>> Cc: rxtx at qbang.org > >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? > >>> > >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > >>>> Dear RXTX community, > >>>> > >>>> I'm wondering what the status is with RXTX locking > >>>> serial ports on Linux? > >>>> > >>>> My understanding is that the mechanism used in > >>>> 2.1-7r2 (lockfiles) is not really state of the art, and > >>>> has lots of problems (e.g. missing permissions). > >>>> > >>>> There was an idea to migrate towards a Kernel > >>>> syscall based solution for port locking. > >>>> > >>>> What's the status here? > >>> > >>> Hi Martin, > >>> > >>> I'm in favor of deprecating the current FHS locking mechanism > >>> in favor of > >>> an IOCTL when available. I think it will be available on all the > >>> platforms but do not know for sure. > >>> > >>> The status is unchanged. I've had very few free cycles for > >>> such things. > >>> Feel free to take a stab at it if you have some time. I > >>> believe the IOCTL > >>> is used in the Mac OS X code already. > >>> > >>> I don't see any real backwards compatability issues and the > >>> IOCTL should > >>> just work. > >>> > >>> -- > >>> Trent Jarvi > >>> tjarvi at qbang.org > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > From Steffen.DETTMER at ingenico.com Tue Apr 29 13:34:44 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 29 Apr 2008 21:34:44 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Message-ID: <20080429193444.GU2928@elberon.bln.de.ingenico.com> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > The biggest problem that I have seen with lockfiles on Linux > At least is, that it seems there is no standard with respect > To the folder in which they should be created. Also, many > Distributions seem to set up file system permissions in such > A way that writing to the lockfile folder is not allowed for > The normal user -- that's why we stopped using lockfiles > In our commercial product. It seems it depends on the expectations. I consider it as a feature that by default a linux user cannot access serial ports. Maybe root connected a modem (can produce phone bills) or even some serial card reader, maybe with the web servers key pair. I would expect that by default a user cannot open the serial port because of insufficient permissions on the device file. I would expect this on other unices as well (but I don't know it). For windows I think it should be similar but not impacting so much in practice, because often windows users work with big permissions on a somewhat high priviledge level or even Administrator. > If we are to still respect lockfiles, we first need to > Understand where we are expected to look for them. Does > Anybody have any insight what variants of lockfile folder > Schema exist out there in the wild? Some apps like minicom > Seem to even allow users to manually specify a lockfile > Folder of their choice. At least my (ancient) minicom does not allow the user to change this option, it is displayed but read-only, but root is allowed to change it. > Because of the difficulty finding the right lockfile folder, > And because of the inherent risk of thinking that something > Might be locked while it actually isn't, I'd suggest that > RXTX should have a "soft-off" feature that allows disabling > ALL Lockfile checks at runtime without recompiling the native > Sharedlibs. sounds very reasonable, yes... and as admin I would not wish that users could skip such locking because they do things wrong by default ;) (in the end I guess that is related to the dilemma, that hotplug/user-owned-periphery and multi-user systems simply conflict) > Trent - I like your strategy outline, but I think that it > Needs to be configurable by the client such that users and/or > Customer Support can disable lockfiles / disable ioctl in > Case they detect that they are runing on an OS / Kernal that > Does not support one or the other. Yes, this would be good I guess... Applications could offer configuration options to control that, maybe similarily as minicom. BTW, man minicom tells: *B - Lock file location On most systems This should be /usr/spool/uucp. Linux systems use /var/lock. If this directory does not exist, minicom will not attempt to use lockfiles. The statement `Linux systems use /var/lock' is interesting, does anyone know the source of this convention? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Tue Apr 29 16:11:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Apr 2008 16:11:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? These details are outlined in the Filesystem Hierarchy Standard (FHS). http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLOCKLOCKFILES -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Tue Apr 29 18:58:09 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Wed, 30 Apr 2008 10:28:09 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: <200804301028.09307.scldad@sdc.com.au> I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is the same. Any ideas as to how to handle this? Stephen On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: > * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > > The biggest problem that I have seen with lockfiles on Linux > > At least is, that it seems there is no standard with respect > > To the folder in which they should be created. Also, many > > Distributions seem to set up file system permissions in such > > A way that writing to the lockfile folder is not allowed for > > The normal user -- that's why we stopped using lockfiles > > In our commercial product. > > It seems it depends on the expectations. I consider it as a > feature that by default a linux user cannot access serial ports. > Maybe root connected a modem (can produce phone bills) or even > some serial card reader, maybe with the web servers key pair. > > I would expect that by default a user cannot open the serial port > because of insufficient permissions on the device file. I would > expect this on other unices as well (but I don't know it). > > For windows I think it should be similar but not impacting so > much in practice, because often windows users work with big > permissions on a somewhat high priviledge level or even > Administrator. > > > If we are to still respect lockfiles, we first need to > > Understand where we are expected to look for them. Does > > Anybody have any insight what variants of lockfile folder > > Schema exist out there in the wild? Some apps like minicom > > Seem to even allow users to manually specify a lockfile > > Folder of their choice. > > At least my (ancient) minicom does not allow the user to change > this option, it is displayed but read-only, but root is allowed > to change it. > > > Because of the difficulty finding the right lockfile folder, > > And because of the inherent risk of thinking that something > > Might be locked while it actually isn't, I'd suggest that > > RXTX should have a "soft-off" feature that allows disabling > > ALL Lockfile checks at runtime without recompiling the native > > Sharedlibs. > > sounds very reasonable, yes... > and as admin I would not wish that users could skip such > locking because they do things wrong by default ;) > > (in the end I guess that is related to the dilemma, that > hotplug/user-owned-periphery and multi-user systems simply > conflict) > > > Trent - I like your strategy outline, but I think that it > > Needs to be configurable by the client such that users and/or > > Customer Support can disable lockfiles / disable ioctl in > > Case they detect that they are runing on an OS / Kernal that > > Does not support one or the other. > > Yes, this would be good I guess... Applications could offer > configuration options to control that, maybe similarily as > minicom. > > BTW, man minicom tells: > > *B - Lock file location > On most systems This should be /usr/spool/uucp. > Linux systems use /var/lock. If this directory > does not exist, minicom will not attempt to use > lockfiles. > > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure > and expedient electronic transaction acceptance. Ingenico products leverage > proven technology, established standards and unparalleled ergonomics to > provide optimal reliability, versatility and usability. This comprehensive > range of products is complemented by a global array of services and > partnerships, enabling businesses in a number of vertical sectors to accept > transactions anywhere their business takes them. www.ingenico.com This > message may contain confidential and/or privileged information. If you are > not the addressee or authorized to receive this for the addressee, you must > not use, copy, disclose or take any action based on this message or any > information herein. If you have received this message in error, please > advise the sender immediately by reply e-mail and delete this message. > Thank you for your cooperation. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Wed Apr 30 19:30:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 30 Apr 2008 19:30:51 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804301028.09307.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> <200804301028.09307.scldad@sdc.com.au> Message-ID: Hi Stephen, I suspect ioctl/TIOCEXCL open/O_EXCL would do the job. Mac uses TIOCEXCL and it is POSIX. We use O_EXCL for lockfiles on Linux already. On Wed, 30 Apr 2008, Stephen Davies wrote: > I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is > the same. > > Any ideas as to how to handle this? > > Stephen > > > On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: >> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: >>> The biggest problem that I have seen with lockfiles on Linux >>> At least is, that it seems there is no standard with respect >>> To the folder in which they should be created. Also, many >>> Distributions seem to set up file system permissions in such >>> A way that writing to the lockfile folder is not allowed for >>> The normal user -- that's why we stopped using lockfiles >>> In our commercial product. >> >> It seems it depends on the expectations. I consider it as a >> feature that by default a linux user cannot access serial ports. >> Maybe root connected a modem (can produce phone bills) or even >> some serial card reader, maybe with the web servers key pair. >> >> I would expect that by default a user cannot open the serial port >> because of insufficient permissions on the device file. I would >> expect this on other unices as well (but I don't know it). >> >> For windows I think it should be similar but not impacting so >> much in practice, because often windows users work with big >> permissions on a somewhat high priviledge level or even >> Administrator. >> >>> If we are to still respect lockfiles, we first need to >>> Understand where we are expected to look for them. Does >>> Anybody have any insight what variants of lockfile folder >>> Schema exist out there in the wild? Some apps like minicom >>> Seem to even allow users to manually specify a lockfile >>> Folder of their choice. >> >> At least my (ancient) minicom does not allow the user to change >> this option, it is displayed but read-only, but root is allowed >> to change it. >> >>> Because of the difficulty finding the right lockfile folder, >>> And because of the inherent risk of thinking that something >>> Might be locked while it actually isn't, I'd suggest that >>> RXTX should have a "soft-off" feature that allows disabling >>> ALL Lockfile checks at runtime without recompiling the native >>> Sharedlibs. >> >> sounds very reasonable, yes... >> and as admin I would not wish that users could skip such >> locking because they do things wrong by default ;) >> >> (in the end I guess that is related to the dilemma, that >> hotplug/user-owned-periphery and multi-user systems simply >> conflict) >> >>> Trent - I like your strategy outline, but I think that it >>> Needs to be configurable by the client such that users and/or >>> Customer Support can disable lockfiles / disable ioctl in >>> Case they detect that they are runing on an OS / Kernal that >>> Does not support one or the other. >> >> Yes, this would be good I guess... Applications could offer >> configuration options to control that, maybe similarily as >> minicom. >> >> BTW, man minicom tells: >> >> *B - Lock file location >> On most systems This should be /usr/spool/uucp. >> Linux systems use /var/lock. If this directory >> does not exist, minicom will not attempt to use >> lockfiles. >> >> The statement `Linux systems use /var/lock' is interesting, does >> anyone know the source of this convention? >> >> oki, >> >> Steffen >> >> About Ingenico Throughout the world businesses rely on Ingenico for secure >> and expedient electronic transaction acceptance. Ingenico products leverage >> proven technology, established standards and unparalleled ergonomics to >> provide optimal reliability, versatility and usability. This comprehensive >> range of products is complemented by a global array of services and >> partnerships, enabling businesses in a number of vertical sectors to accept >> transactions anywhere their business takes them. www.ingenico.com This >> message may contain confidential and/or privileged information. If you are >> not the addressee or authorized to receive this for the addressee, you must >> not use, copy, disclose or take any action based on this message or any >> information herein. If you have received this message in error, please >> advise the sender immediately by reply e-mail and delete this message. >> Thank you for your cooperation. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0037.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0035.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0022.html From pboulton at pulsetracer.com Fri Apr 18 14:30:13 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Fri, 18 Apr 2008 13:30:13 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site Message-ID: <480904D5.1060307@pulsetracer.com> Hello, gentle serial porters. I have downloaded the zipped up binaries for use on Windows without Sun's CommAPI, but don't seem able to extract anything from the download. Go to main page, http://www.rxtx.org/ Click on Downloads I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) And I save it to disk. If I try and extract the files with WinZip, Winzip thinks the archive is corrupt. If I try using Windows Explorer, I am able to extract it into a single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than the original .zip. Any help would be much appreciated. Sincerely, Philip Boulton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080418/97d89793/attachment-0020.html From tjarvi at qbang.org Fri Apr 18 19:07:00 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 18 Apr 2008 19:07:00 -0600 (MDT) Subject: [Rxtx] Difficulty opening zip file at rxtx site In-Reply-To: <480904D5.1060307@pulsetracer.com> References: <480904D5.1060307@pulsetracer.com> Message-ID: On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org From pboulton at pulsetracer.com Sat Apr 19 12:46:26 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Sat, 19 Apr 2008 11:46:26 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site References: <480904D5.1060307@pulsetracer.com> Message-ID: <53DB7576450695419E09299104043761A78533@ZTGSERVER.ztg.local> I have been able to get my hands on the binaries, by going to the ftp directory /pub/rxtx at ftp.qbang.org,, and ftping the file rxtx-2.1-7-bins-r2.zip . This opens happily with Winzip, and extracts as the set of files that you describe below. I only experience the ill-formed archive problem by clicking the link on the rxtx.org Downloads page (http://rxtx.qbang.org/pub/rxtx/ rxtx-2.1-7-bins-r2.zip ). Not sure what to make of that. Philip Boulton ________________________________ From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Fri 4/18/2008 6:07 PM To: Philip Boulton Cc: rxtx at qbang.org Subject: Re: [Rxtx] Difficulty opening zip file at rxtx site On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080419/147923bb/attachment-0019.html From jlar310 at gmail.com Sat Apr 19 19:11:55 2008 From: jlar310 at gmail.com (Jeff Larsen) Date: Sat, 19 Apr 2008 20:11:55 -0500 Subject: [Rxtx] Moxa serial over Ethernet driver Message-ID: Hi all, I've been using javax.comm for years to communicate with a legacy radio data system. We want to migrate the java side of the system to a VMware Server virtual machine. We've had great success using Moxa DE-303 and 5610 serial over Ethernet appliances and virtual machines for running hylafax. The OS (Linux in this case) uses a kernel driver to communicate with the Moxa via a virtual serial port such as /dev/ttyr00. I want to do the same thing with javax.comm or gnu.io to connect to a virtual serial port. However I'm hitting road blocks everywhere. javax.comm for Linux sees the virtual port, but there are transmission errors. Tried Solaris too, but the Solaris Moxa drivers don't play nice with javax.comm because the driver uses /dev/pts/n instead of /dev/term/x. Next I tried RXTX on Linux, but I'm getting NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX on Solaris. Has anyone used RXTX with serial over Ethernet devices? Any hints on how to make it work? I know that I'm not completely off track because javax.comm does work with Moxa on a Windows platform, but that's just not an option for production deployment. -- Jeff From tjarvi at qbang.org Sat Apr 19 21:08:41 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 19 Apr 2008 21:08:41 -0600 (MDT) Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: yOn Sat, 19 Apr 2008, Jeff Larsen wrote: > Hi all, > > I've been using javax.comm for years to communicate with a legacy > radio data system. We want to migrate the java side of the system to a > VMware Server virtual machine. We've had great success using Moxa > DE-303 and 5610 serial over Ethernet appliances and virtual machines > for running hylafax. The OS (Linux in this case) uses a kernel driver > to communicate with the Moxa via a virtual serial port such as > /dev/ttyr00. > > I want to do the same thing with javax.comm or gnu.io to connect to a > virtual serial port. However I'm hitting road blocks everywhere. > javax.comm for Linux sees the virtual port, but there are transmission > errors. Tried Solaris too, but the Solaris Moxa drivers don't play > nice with javax.comm because the driver uses /dev/pts/n instead of > /dev/term/x. Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris. > > Has anyone used RXTX with serial over Ethernet devices? Any hints on > how to make it work? > > I know that I'm not completely off track because javax.comm does work > with Moxa on a Windows platform, but that's just not an option for > production deployment. > > Moxa should work under linux. There may be minor issues depending upon how complete the kernel driver is but I think it will work. One of the minor issues is /dev/ttyr00 is not enumerated. There are several work arounds documented with the source code and on the wiki. The easiest solution for testing purposes is to make a symbolic link from /dev/ttyr00 to a port that is enumerated such as /dev/ttyS129. You can later alter the rxtx source or use properties to change the enumerated ports. -- Trent Jarvi tjarvi at qbang.org From d.tonhofer at m-plify.com Sun Apr 20 03:33:30 2008 From: d.tonhofer at m-plify.com (David Tonhofer (M-PLIFY S.A.)) Date: Sun, 20 Apr 2008 11:33:30 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: <480B0DEA.5010908@m-plify.com> Jeff Larsen wrote: > Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris It might be that the Java side of RXTX does not recognize that portname. Trying modifying src/RXTXCommDriver.java as described in this case: http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card From ajmas at sympatico.ca Sun Apr 20 16:37:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Apr 2008 18:37:59 -0400 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <480B0DEA.5010908@m-plify.com> References: <480B0DEA.5010908@m-plify.com> Message-ID: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > Jeff Larsen wrote: >> Next I tried RXTX on Linux, but I'm getting >> NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX >> on Solaris > It might be that the Java side of RXTX does not recognize that > portname. > Trying modifying src/RXTXCommDriver.java as described in this case: > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card I wonder whether it would be worth allowing custom port prefixes as a system parameter? For example: gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" Andre From Martin.Oberhuber at windriver.com Tue Apr 22 12:34:36 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 22 Apr 2008 20:34:36 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> References: <480B0DEA.5010908@m-plify.com> <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE6485848056CD6CE@ism-mail03.corp.ad.wrs.com> Sounds like a great idea... I'm wondering how the "variable part" after the Prefixes could be specified though? What about allowing Regular Expression character Classes in the existing System Property for specifying ports: System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyS[0-9],ttyS[ABC],ttyUSB[0-9a-z]"); The set of allowed patterns would of course need to Be restricted compared to REGEX, because it must be A syntax that supports iterating over it. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Montag, 21. April 2008 00:38 > To: rxtx at qbang.org and Users > Subject: Re: [Rxtx] Moxa serial over Ethernet driver > > > On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > > Jeff Larsen wrote: > >> Next I tried RXTX on Linux, but I'm getting > >> NoSuchPortException connecting to /dev/ttyr00. I have yet > to try RXTX > >> on Solaris > > It might be that the Java side of RXTX does not recognize that > > portname. > > Trying modifying src/RXTXCommDriver.java as described in this case: > > > > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_ > SST-4P.2FLP_multiport_card > > I wonder whether it would be worth allowing custom port > prefixes as a > system parameter? For > example: > > gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Loi.TRAN at weatherford.com Tue Apr 22 13:10:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Tue, 22 Apr 2008 14:10:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled Message-ID: Hi, I'm currently using the Java RXTX API to interface to a serial port. The serial port is connected to a bridge board that communicates with our communications system running at 1.875 Mbps which is linked to an embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no flow control). I send a command to the embedded board through the serial-bridge board which then is relayed to the embedded board. The command sent asks the embedded board to dump a binary image. Here's where I'm hitting some problems. I've successfully done this is an integrated serial port from the laptop. The binary file that comes back is consistent on every attempt. When I use the application I've written to do the same thing with a USB-to-serial adapter, the image I get back is not the same as the image I receive through the USB-to-serial adapter is not consistent at all. A final thing is that when I use a terminal program to dump the binary image with the USB-serial adapter, the image is correct. Every time! What is the terminal program doing that's not being done in my application? My application is quite simple. Has anyone observed this behavior before? If you have, I'd like to know how you've gotten around this problem. Thanks, LT =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From tjarvi at qbang.org Tue Apr 22 21:11:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 22 Apr 2008 21:11:10 -0600 (MDT) Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org From Loi.TRAN at weatherford.com Wed Apr 23 08:35:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Wed, 23 Apr 2008 09:35:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: Thanks for all the responses. I finally tried something that worked consistently. I updated my Prolific driver and repeated my tests. It worked. If you're using the Prolific type USB-serial adapters, do no use the Prolific version 2.0.2.1 driver on Windows. Update it to the latest 2.0.2.8 version. Again, thanks for all the responses. LT -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Tuesday, April 22, 2008 10:11 PM To: TRAN, Loi X. Cc: rxtx at qbang.org Subject: Re: [Rxtx] Prolific USB - RXTX data mangled On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From Martin.Oberhuber at windriver.com Wed Apr 23 18:54:26 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 02:54:26 +0200 Subject: [Rxtx] RXTX port locking on Linux status? Message-ID: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Dear RXTX community, I'm wondering what the status is with RXTX locking serial ports on Linux? My understanding is that the mechanism used in 2.1-7r2 (lockfiles) is not really state of the art, and has lots of problems (e.g. missing permissions). There was an idea to migrate towards a Kernel syscall based solution for port locking. What's the status here? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/9878db9f/attachment-0015.html From tjarvi at qbang.org Wed Apr 23 20:32:24 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Apr 2008 20:32:24 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > Dear RXTX community, > > I'm wondering what the status is with RXTX locking > serial ports on Linux? > > My understanding is that the mechanism used in > 2.1-7r2 (lockfiles) is not really state of the art, and > has lots of problems (e.g. missing permissions). > > There was an idea to migrate towards a Kernel > syscall based solution for port locking. > > What's the status here? > Hi Martin, I'm in favor of deprecating the current FHS locking mechanism in favor of an IOCTL when available. I think it will be available on all the platforms but do not know for sure. The status is unchanged. I've had very few free cycles for such things. Feel free to take a stab at it if you have some time. I believe the IOCTL is used in the Mac OS X code already. I don't see any real backwards compatability issues and the IOCTL should just work. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Apr 24 06:14:06 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 14:14:06 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Thanks Trent. Problem is only that I'm really not at all Familiar with the C part of RXTX. If there Were anything I could do in Java for this, It would be easier for me.... ... Are there any C experts here on the list Who'd like to look at ioctl port locking For linux? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Donnerstag, 24. April 2008 04:32 > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > I'm wondering what the status is with RXTX locking > > serial ports on Linux? > > > > My understanding is that the mechanism used in > > 2.1-7r2 (lockfiles) is not really state of the art, and > > has lots of problems (e.g. missing permissions). > > > > There was an idea to migrate towards a Kernel > > syscall based solution for port locking. > > > > What's the status here? > > > > Hi Martin, > > I'm in favor of deprecating the current FHS locking mechanism > in favor of > an IOCTL when available. I think it will be available on all the > platforms but do not know for sure. > > The status is unchanged. I've had very few free cycles for > such things. > Feel free to take a stab at it if you have some time. I > believe the IOCTL > is used in the Mac OS X code already. > > I don't see any real backwards compatability issues and the > IOCTL should > just work. > > -- > Trent Jarvi > tjarvi at qbang.org > From sspies at sloc.de Thu Apr 24 07:15:36 2008 From: sspies at sloc.de (Sebastian Spies) Date: Thu, 24 Apr 2008 15:15:36 +0200 (CEST) Subject: [Rxtx] rxtx on gumstix: Interrupted system call In-Reply-To: <47FB7B20.7080504@sloc.de> References: <47FB7B20.7080504@sloc.de> Message-ID: <55445.130.83.139.205.1209042936.squirrel@ssl.sloc.de> Dear list, while porting rxtx to the gumstix, I found out, that select used in readArray in SerialImp.c might not work as expected. Maybe, because of missing TIOCSERGETLSR-support? select is often interrupted, so i wrote the following quick'n'dirty hack to make it work on gumstix: diff -Nur rxtx-2.1-7r2/src/SerialImp.c rxtx-2.1-7r2/src/SerialImp.c --- rxtx-2.1-7r2/src/SerialImp.c 2006-01-29 23:19:04.000000000 +0100 +++ rxtx-2.1-7r2-patched/src/SerialImp.c 2008-04-24 14:30:17.000000000 +0200 @@ -3380,7 +3381,7 @@ JNIEXPORT jint JNICALL RXTXPort(readArray)( JNIEnv *env, jobject jobj, jbyteArray jbarray, jint offset, jint length ) { - int bytes; + int bytes = 0; jbyte *body; /* char msg[80]; */ int fd = get_java_var( env, jobj, "fd", "I" ); @@ -3397,9 +3398,18 @@ "readArray", "Invalid length" ); return -1; } - body = (*env)->GetByteArrayElements( env, jbarray, 0 ); - bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ - (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + while(1 > bytes) + { + body = (*env)->GetByteArrayElements( env, jbarray, 0 ); + bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ + (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + // quick'n'dirty - SSP + report (" trying again... \n"); + errno = 0; + } + if( bytes < 0 ) { report( "RXTXPort:readArray bytes < 0" ); LEAVE( "RXTXPort:readArray" ); > Hey, > > I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use > RXTXPort$SerialInputStream.read(), then I get the following Exception. I > did not yet figure out which system call is interrupted as strace > produces loads of output. > > Any help would be very appreciated. Thanks in advance. > Sebastian > > > [java] java.io.IOException: Interrupted system call in readArray > [java] at gnu.io.RXTXPort.readArray(Native Method) > [java] at > gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) > [java] at > java.io.FilterInputStream.read(FilterInputStream.java:189) > [java] at > java.io.BufferedInputStream.refill(BufferedInputStream.java:371) > [java] at > java.io.BufferedInputStream.read(BufferedInputStream.java:229) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) > [java] at > com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) > > -- > Sebastian Spies > > mail: sspies at sloc.de > > > > From fire_baptized at hotmail.com Thu Apr 24 18:27:48 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Thu, 24 Apr 2008 20:27:48 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hello I am having a problem with the serial device connecting (software wise) to the serial port. However I have a test program and it seems to work just fine in that environment - and it doesnt use GUI. The error I am getting is : PortNotFoundException Now the way I have it setup in the GUI environment is that once the user pushes a JButton the program connects using this class: protected void establishConnection() { try { portId = CommPortIdentifier.getPortIdentifier("COM3"); System.out.println("Establishing connction....."); messages[0] = "\nEstablishing connction.....\n"; } catch ( NoSuchPortException noport) { System.out.println("Port not found: "+ noport); messages[0] = "Port not found: "+ noport+"\n"; } try { serialPort = (SerialPort) portId.open("serial", 50); System.out.println("Port has been found."); messages[1] = "Port has been found.\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[1] = "" +usedport; } try { serialPort = (SerialPort) portId.open("serial", 50); messages[2] = "Connecting to COM3 on port 50....\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; } try { serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); System.out.println("Esablishing the transfer rate settings for COM3."); messages[3] = "Esablishing the transfer rate settings for COM3.\n"; } catch (UnsupportedCommOperationException nosupcom) { System.out.println(nosupcom); System.out.println("The tranfer rate could not be esblished on COM3."); messages[3] = "The tranfer rate could not be esblished on COM3.\n"; } System.out.println(serialPort.getFlowControlMode()); messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; //sendDataOut(buffer[3],buffer[4]); } I need all the data in this method (and all the string values in this method) to be printed out on a JTextArea. I wont do me any good if not all the text is printed on a JTextArea in another class. So I have the text printing the JTextArea correctly, but everytime the JButton is activated - it gives me that error message. I did add a disconnect button that is supposed to call the serialPort.close(). _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/273fd4ec/attachment-0014.html From tjarvi at qbang.org Thu Apr 24 21:54:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Apr 2008 21:54:10 -0600 (MDT) Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > Hello I am having a problem with the serial device connecting (software > wise) to the serial port. However I have a test program and it seems to > work just fine in that environment - and it doesnt use GUI. The error I > am getting is : PortNotFoundException Now the way I have it setup in the > GUI environment is that once the user pushes a JButton the program > connects using this class: > > protected void establishConnection() { > try { > portId = CommPortIdentifier.getPortIdentifier("COM3"); > System.out.println("Establishing connction....."); > messages[0] = "\nEstablishing connction.....\n"; > } > catch ( NoSuchPortException noport) { > System.out.println("Port not found: "+ noport); > messages[0] = "Port not found: "+ noport+"\n"; > } > try { > serialPort = (SerialPort) portId.open("serial", 50); > System.out.println("Port has been found."); > messages[1] = "Port has been found.\n"; > } > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[1] = "" +usedport; > } ================================================================= > try { > serialPort = (SerialPort) portId.open("serial", 50); > messages[2] = "Connecting to COM3 on port 50....\n"; > } ================================================================== > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > } > try { > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > System.out.println("Esablishing the transfer rate settings for COM3."); > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > } > catch (UnsupportedCommOperationException nosupcom) { > System.out.println(nosupcom); > System.out.println("The tranfer rate could not be esblished on COM3."); > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > } > System.out.println(serialPort.getFlowControlMode()); > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > //sendDataOut(buffer[3],buffer[4]); > } > > I need all the data in this method (and all the string values in this > method) to be printed out on a JTextArea. I wont do me any good if not > all the text is printed on a JTextArea in another class. So I have the > text printing the JTextArea correctly, but everytime the JButton is > activated - it gives me that error message. I did add a disconnect > button that is supposed to call the serialPort.close(). > The open code used twice is going to throw an exception. It may be that you catch the exception above this code and print a confusing message? A common mistake is people will accidently run two copies of their program. The first instance of the program will open the port and prevent enumeration (finding the port) in the second instance of the program. As an example, you may be running your text based application which is preventing the GUI from seeing the port. Enumeration is done by trying to open the port. If the port is open, Enumeration fails. -- Trent Jarvi tjarvi at qbang.org From fire_baptized at hotmail.com Thu Apr 24 22:32:05 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 00:32:05 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Wow - thanks dude what a dumb thing for me to not catch..... now here is the current problem - right now I am trying to output data again one is with the test program - and it seems that serialPort.setRTS(true); is throwing an exceptions there - now if I show this code please bare in mind that I am only testing - the code is kinda sloppy in my mind - but if I can figure out why calling this function is throwing an exception then maybe I can figure out why my GUI application is getting the same null pointer exceptions when try to send out the data stream. FYI Trent this email is not directed towards you - anyone can jump in on this public static void main(String args[]) { byte[] b = new byte[64]; int keyinput = 0 ; byte x = 0; byte y = 0; PortTesting1 testports = new PortTesting1(); try { joyskoro = Joystick.createInstance(); } catch (IOException ioexc) { System.out.println("There is an input/output problem: " + ioexc); } while (true) { joyskoro.poll(); b[0] = ((byte) -(10 * joyskoro.getY())); b[1] = ((byte) (10 * joyskoro.getX())); System.out.println("The 3rd byte is: " +b[0]); System.out.println("The 4rd byte is: " +b[1]); serialPort.setRTS(true); // HERE IS WHERE THE PROBLEM IS !!!!!!! ON THIS LINE but if I dont have it active in my program the Bluetooth device (that is System.out.println("Ready to send :-) !"); //connected to the serial port does not send out data!!!!! if (joyskoro.isButtonDown(joyskoro.BUTTON10)) { System.out.println("Connection terminated."); serialPort.close(); break; } if (joyskoro.isButtonDown(joyskoro.BUTTON2)) { boolean flag = true; //reading from key input from the keyboard System.out.println("Please input a command: "); while (flag) { try { keyinput = System.in.read(); } catch (IOException ioexc) {/*there is no need to put * anything here */ } if((char)keyinput=='w') { pushIt((byte)85); } if((char)keyinput=='s') { pushIt((byte)84); } if((char)keyinput=='a') { pushIt((byte)83); } if((char)keyinput=='d') { pushIt((byte)82); } if((char)keyinput=='q') { pushIt((byte)89); } if((char)keyinput=='\t') { //this stop reading input from the keyboard flag = false; } } and help anyways here is the block of code that throwing an exception for the test program: > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/5c8f7d68/attachment-0014.html From fire_baptized at hotmail.com Fri Apr 25 07:59:53 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 09:59:53 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Are there any examples of how to push out data? As in using input and output streams - if I can compare code maybe I can see where this is causing a problem. I have a byte array that I am pushing out data. I keep getting null pointer exceptions every where I turn. > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/22228ab6/attachment-0013.html From ajmas at sympatico.ca Sat Apr 26 07:37:09 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 26 Apr 2008 09:37:09 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hi, On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote: > > Are there any examples of how to push out data? As in using input > and output streams - if I can compare code maybe I can see where > this is causing a problem. I have a byte array that I am pushing > out data. I keep getting null pointer exceptions every where I turn. > There are some examples here that might be of help: http://rxtx.qbang.org/wiki/index.php/Examples Andre From fire_baptized at hotmail.com Sat Apr 26 20:13:54 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Sat, 26 Apr 2008 22:13:54 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: looked at those....yep didnt help - I need to push out data with GUI and not get a null pointer exception everytime I try. > CC: rxtx at qbang.org> From: ajmas at sympatico.ca> To: fire_baptized at hotmail.com> Subject: Re: [Rxtx] Serial Problems with Gui.....> Date: Sat, 26 Apr 2008 09:37:09 -0400> > Hi,> > > On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote:> >> > Are there any examples of how to push out data? As in using input > > and output streams - if I can compare code maybe I can see where > > this is causing a problem. I have a byte array that I am pushing > > out data. I keep getting null pointer exceptions every where I turn.> >> > There are some examples here that might be of help:> > http://rxtx.qbang.org/wiki/index.php/Examples> > Andre _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080426/09f95b41/attachment-0012.html From michael.erskine at ketech.com Mon Apr 28 02:47:22 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 28 Apr 2008 09:47:22 +0100 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D426EF3CBBC5@no-sv-03.ketech.local> Jesrael D. Summerhill wrote: > looked at those....yep didnt help - I need to push out data with GUI and > not get a null pointer exception everytime I try. So it seems pretty obvious that your code needs to check for nulls wherever one may occur and report what's happening. Alternatively, catch the npe and display the stack trace. Then you can fix your code so it doesn't try to work with something that ain't there. Regards, Michael Erskine. From scldad at sdc.com.au Mon Apr 28 03:58:34 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Mon, 28 Apr 2008 19:28:34 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Message-ID: <200804281928.34454.scldad@sdc.com.au> Has anybody done any design work on this? The first thing that springs to mind is that we still need to check for lock files because other apps tend to use that approach even if we go to ioctl. Cheers, Stephen Davies On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > Thanks Trent. > > Problem is only that I'm really not at all > Familiar with the C part of RXTX. If there > Were anything I could do in Java for this, > It would be easier for me.... > > ... Are there any C experts here on the list > Who'd like to look at ioctl port locking > For linux? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > -----Original Message----- > > From: Trent Jarvi [mailto:tjarvi at qbang.org] > > Sent: Donnerstag, 24. April 2008 04:32 > > To: Oberhuber, Martin > > Cc: rxtx at qbang.org > > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > > > I'm wondering what the status is with RXTX locking > > > serial ports on Linux? > > > > > > My understanding is that the mechanism used in > > > 2.1-7r2 (lockfiles) is not really state of the art, and > > > has lots of problems (e.g. missing permissions). > > > > > > There was an idea to migrate towards a Kernel > > > syscall based solution for port locking. > > > > > > What's the status here? > > > > Hi Martin, > > > > I'm in favor of deprecating the current FHS locking mechanism > > in favor of > > an IOCTL when available. I think it will be available on all the > > platforms but do not know for sure. > > > > The status is unchanged. I've had very few free cycles for > > such things. > > Feel free to take a stab at it if you have some time. I > > believe the IOCTL > > is used in the Mac OS X code already. > > > > I don't see any real backwards compatability issues and the > > IOCTL should > > just work. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Mon Apr 28 04:21:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 28 Apr 2008 04:21:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804281928.34454.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: I don't think there would need to be any architectural changes. A couple ifdefs and minor changes in the current code should be enough. Proposal: FHS/UUCP locks: continue to respect them, try to create them but do not error if the IOCTL is supported. (But does the IOCTL being defined mean it will work?) Enumeration: Do not assert the IOCTL while opening. Serial.open: assert the IOCTL after open. Continue to use locks as described above after asserting the IOCTL. If the IOCTL is defined but not working, handle it here. Failure cases include the IOCTL is not supported and the port is already locked. On Mon, 28 Apr 2008, Stephen Davies wrote: > Has anybody done any design work on this? > The first thing that springs to mind is that we still need to check for lock > files because other apps tend to use that approach even if we go to ioctl. > > Cheers, > Stephen Davies > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: >> Thanks Trent. >> >> Problem is only that I'm really not at all >> Familiar with the C part of RXTX. If there >> Were anything I could do in Java for this, >> It would be easier for me.... >> >> ... Are there any C experts here on the list >> Who'd like to look at ioctl port locking >> For linux? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >>> -----Original Message----- >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] >>> Sent: Donnerstag, 24. April 2008 04:32 >>> To: Oberhuber, Martin >>> Cc: rxtx at qbang.org >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? >>> >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: >>>> Dear RXTX community, >>>> >>>> I'm wondering what the status is with RXTX locking >>>> serial ports on Linux? >>>> >>>> My understanding is that the mechanism used in >>>> 2.1-7r2 (lockfiles) is not really state of the art, and >>>> has lots of problems (e.g. missing permissions). >>>> >>>> There was an idea to migrate towards a Kernel >>>> syscall based solution for port locking. >>>> >>>> What's the status here? >>> >>> Hi Martin, >>> >>> I'm in favor of deprecating the current FHS locking mechanism >>> in favor of >>> an IOCTL when available. I think it will be available on all the >>> platforms but do not know for sure. >>> >>> The status is unchanged. I've had very few free cycles for >>> such things. >>> Feel free to take a stab at it if you have some time. I >>> believe the IOCTL >>> is used in the Mac OS X code already. >>> >>> I don't see any real backwards compatability issues and the >>> IOCTL should >>> just work. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Tue Apr 29 12:04:04 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Apr 2008 20:04:04 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Hi all, The biggest problem that I have seen with lockfiles on Linux At least is, that it seems there is no standard with respect To the folder in which they should be created. Also, many Distributions seem to set up file system permissions in such A way that writing to the lockfile folder is not allowed for The normal user -- that's why we stopped using lockfiles In our commercial product. If we are to still respect lockfiles, we first need to Understand where we are expected to look for them. Does Anybody have any insight what variants of lockfile folder Schema exist out there in the wild? Some apps like minicom Seem to even allow users to manually specify a lockfile Folder of their choice. Because of the difficulty finding the right lockfile folder, And because of the inherent risk of thinking that something Might be locked while it actually isn't, I'd suggest that RXTX should have a "soft-off" feature that allows disabling ALL Lockfile checks at runtime without recompiling the native Sharedlibs. Trent - I like your strategy outline, but I think that it Needs to be configurable by the client such that users and/or Customer Support can disable lockfiles / disable ioctl in Case they detect that they are runing on an OS / Kernal that Does not support one or the other. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Montag, 28. April 2008 12:22 > To: Stephen Davies > Cc: rxtx at qbang.org; Oberhuber, Martin; Trent Jarvi > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > I don't think there would need to be any architectural > changes. A couple > ifdefs and minor changes in the current code should be enough. > > Proposal: > > FHS/UUCP locks: > continue to respect them, try to create them but do not error if > the IOCTL is supported. (But does the IOCTL being defined mean > it will work?) > Enumeration: > Do not assert the IOCTL while opening. > Serial.open: > assert the IOCTL after open. Continue to use locks as described > above after asserting the IOCTL. If the IOCTL is defined but > not working, handle it here. Failure cases include the IOCTL > is not supported and the port is already locked. > > On Mon, 28 Apr 2008, Stephen Davies wrote: > > > Has anybody done any design work on this? > > The first thing that springs to mind is that we still need > to check for lock > > files because other apps tend to use that approach even if > we go to ioctl. > > > > Cheers, > > Stephen Davies > > > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > >> Thanks Trent. > >> > >> Problem is only that I'm really not at all > >> Familiar with the C part of RXTX. If there > >> Were anything I could do in Java for this, > >> It would be easier for me.... > >> > >> ... Are there any C experts here on the list > >> Who'd like to look at ioctl port locking > >> For linux? > >> > >> Thanks, > >> -- > >> Martin Oberhuber, Senior Member of Technical Staff, Wind River > >> Target Management Project Lead, DSDP PMC Member > >> http://www.eclipse.org/dsdp/tm > >> > >>> -----Original Message----- > >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] > >>> Sent: Donnerstag, 24. April 2008 04:32 > >>> To: Oberhuber, Martin > >>> Cc: rxtx at qbang.org > >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? > >>> > >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > >>>> Dear RXTX community, > >>>> > >>>> I'm wondering what the status is with RXTX locking > >>>> serial ports on Linux? > >>>> > >>>> My understanding is that the mechanism used in > >>>> 2.1-7r2 (lockfiles) is not really state of the art, and > >>>> has lots of problems (e.g. missing permissions). > >>>> > >>>> There was an idea to migrate towards a Kernel > >>>> syscall based solution for port locking. > >>>> > >>>> What's the status here? > >>> > >>> Hi Martin, > >>> > >>> I'm in favor of deprecating the current FHS locking mechanism > >>> in favor of > >>> an IOCTL when available. I think it will be available on all the > >>> platforms but do not know for sure. > >>> > >>> The status is unchanged. I've had very few free cycles for > >>> such things. > >>> Feel free to take a stab at it if you have some time. I > >>> believe the IOCTL > >>> is used in the Mac OS X code already. > >>> > >>> I don't see any real backwards compatability issues and the > >>> IOCTL should > >>> just work. > >>> > >>> -- > >>> Trent Jarvi > >>> tjarvi at qbang.org > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > From Steffen.DETTMER at ingenico.com Tue Apr 29 13:34:44 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 29 Apr 2008 21:34:44 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Message-ID: <20080429193444.GU2928@elberon.bln.de.ingenico.com> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > The biggest problem that I have seen with lockfiles on Linux > At least is, that it seems there is no standard with respect > To the folder in which they should be created. Also, many > Distributions seem to set up file system permissions in such > A way that writing to the lockfile folder is not allowed for > The normal user -- that's why we stopped using lockfiles > In our commercial product. It seems it depends on the expectations. I consider it as a feature that by default a linux user cannot access serial ports. Maybe root connected a modem (can produce phone bills) or even some serial card reader, maybe with the web servers key pair. I would expect that by default a user cannot open the serial port because of insufficient permissions on the device file. I would expect this on other unices as well (but I don't know it). For windows I think it should be similar but not impacting so much in practice, because often windows users work with big permissions on a somewhat high priviledge level or even Administrator. > If we are to still respect lockfiles, we first need to > Understand where we are expected to look for them. Does > Anybody have any insight what variants of lockfile folder > Schema exist out there in the wild? Some apps like minicom > Seem to even allow users to manually specify a lockfile > Folder of their choice. At least my (ancient) minicom does not allow the user to change this option, it is displayed but read-only, but root is allowed to change it. > Because of the difficulty finding the right lockfile folder, > And because of the inherent risk of thinking that something > Might be locked while it actually isn't, I'd suggest that > RXTX should have a "soft-off" feature that allows disabling > ALL Lockfile checks at runtime without recompiling the native > Sharedlibs. sounds very reasonable, yes... and as admin I would not wish that users could skip such locking because they do things wrong by default ;) (in the end I guess that is related to the dilemma, that hotplug/user-owned-periphery and multi-user systems simply conflict) > Trent - I like your strategy outline, but I think that it > Needs to be configurable by the client such that users and/or > Customer Support can disable lockfiles / disable ioctl in > Case they detect that they are runing on an OS / Kernal that > Does not support one or the other. Yes, this would be good I guess... Applications could offer configuration options to control that, maybe similarily as minicom. BTW, man minicom tells: *B - Lock file location On most systems This should be /usr/spool/uucp. Linux systems use /var/lock. If this directory does not exist, minicom will not attempt to use lockfiles. The statement `Linux systems use /var/lock' is interesting, does anyone know the source of this convention? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Tue Apr 29 16:11:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Apr 2008 16:11:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? These details are outlined in the Filesystem Hierarchy Standard (FHS). http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLOCKLOCKFILES -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Tue Apr 29 18:58:09 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Wed, 30 Apr 2008 10:28:09 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: <200804301028.09307.scldad@sdc.com.au> I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is the same. Any ideas as to how to handle this? Stephen On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: > * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > > The biggest problem that I have seen with lockfiles on Linux > > At least is, that it seems there is no standard with respect > > To the folder in which they should be created. Also, many > > Distributions seem to set up file system permissions in such > > A way that writing to the lockfile folder is not allowed for > > The normal user -- that's why we stopped using lockfiles > > In our commercial product. > > It seems it depends on the expectations. I consider it as a > feature that by default a linux user cannot access serial ports. > Maybe root connected a modem (can produce phone bills) or even > some serial card reader, maybe with the web servers key pair. > > I would expect that by default a user cannot open the serial port > because of insufficient permissions on the device file. I would > expect this on other unices as well (but I don't know it). > > For windows I think it should be similar but not impacting so > much in practice, because often windows users work with big > permissions on a somewhat high priviledge level or even > Administrator. > > > If we are to still respect lockfiles, we first need to > > Understand where we are expected to look for them. Does > > Anybody have any insight what variants of lockfile folder > > Schema exist out there in the wild? Some apps like minicom > > Seem to even allow users to manually specify a lockfile > > Folder of their choice. > > At least my (ancient) minicom does not allow the user to change > this option, it is displayed but read-only, but root is allowed > to change it. > > > Because of the difficulty finding the right lockfile folder, > > And because of the inherent risk of thinking that something > > Might be locked while it actually isn't, I'd suggest that > > RXTX should have a "soft-off" feature that allows disabling > > ALL Lockfile checks at runtime without recompiling the native > > Sharedlibs. > > sounds very reasonable, yes... > and as admin I would not wish that users could skip such > locking because they do things wrong by default ;) > > (in the end I guess that is related to the dilemma, that > hotplug/user-owned-periphery and multi-user systems simply > conflict) > > > Trent - I like your strategy outline, but I think that it > > Needs to be configurable by the client such that users and/or > > Customer Support can disable lockfiles / disable ioctl in > > Case they detect that they are runing on an OS / Kernal that > > Does not support one or the other. > > Yes, this would be good I guess... Applications could offer > configuration options to control that, maybe similarily as > minicom. > > BTW, man minicom tells: > > *B - Lock file location > On most systems This should be /usr/spool/uucp. > Linux systems use /var/lock. If this directory > does not exist, minicom will not attempt to use > lockfiles. > > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure > and expedient electronic transaction acceptance. Ingenico products leverage > proven technology, established standards and unparalleled ergonomics to > provide optimal reliability, versatility and usability. This comprehensive > range of products is complemented by a global array of services and > partnerships, enabling businesses in a number of vertical sectors to accept > transactions anywhere their business takes them. www.ingenico.com This > message may contain confidential and/or privileged information. If you are > not the addressee or authorized to receive this for the addressee, you must > not use, copy, disclose or take any action based on this message or any > information herein. If you have received this message in error, please > advise the sender immediately by reply e-mail and delete this message. > Thank you for your cooperation. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Wed Apr 30 19:30:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 30 Apr 2008 19:30:51 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804301028.09307.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> <200804301028.09307.scldad@sdc.com.au> Message-ID: Hi Stephen, I suspect ioctl/TIOCEXCL open/O_EXCL would do the job. Mac uses TIOCEXCL and it is POSIX. We use O_EXCL for lockfiles on Linux already. On Wed, 30 Apr 2008, Stephen Davies wrote: > I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is > the same. > > Any ideas as to how to handle this? > > Stephen > > > On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: >> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: >>> The biggest problem that I have seen with lockfiles on Linux >>> At least is, that it seems there is no standard with respect >>> To the folder in which they should be created. Also, many >>> Distributions seem to set up file system permissions in such >>> A way that writing to the lockfile folder is not allowed for >>> The normal user -- that's why we stopped using lockfiles >>> In our commercial product. >> >> It seems it depends on the expectations. I consider it as a >> feature that by default a linux user cannot access serial ports. >> Maybe root connected a modem (can produce phone bills) or even >> some serial card reader, maybe with the web servers key pair. >> >> I would expect that by default a user cannot open the serial port >> because of insufficient permissions on the device file. I would >> expect this on other unices as well (but I don't know it). >> >> For windows I think it should be similar but not impacting so >> much in practice, because often windows users work with big >> permissions on a somewhat high priviledge level or even >> Administrator. >> >>> If we are to still respect lockfiles, we first need to >>> Understand where we are expected to look for them. Does >>> Anybody have any insight what variants of lockfile folder >>> Schema exist out there in the wild? Some apps like minicom >>> Seem to even allow users to manually specify a lockfile >>> Folder of their choice. >> >> At least my (ancient) minicom does not allow the user to change >> this option, it is displayed but read-only, but root is allowed >> to change it. >> >>> Because of the difficulty finding the right lockfile folder, >>> And because of the inherent risk of thinking that something >>> Might be locked while it actually isn't, I'd suggest that >>> RXTX should have a "soft-off" feature that allows disabling >>> ALL Lockfile checks at runtime without recompiling the native >>> Sharedlibs. >> >> sounds very reasonable, yes... >> and as admin I would not wish that users could skip such >> locking because they do things wrong by default ;) >> >> (in the end I guess that is related to the dilemma, that >> hotplug/user-owned-periphery and multi-user systems simply >> conflict) >> >>> Trent - I like your strategy outline, but I think that it >>> Needs to be configurable by the client such that users and/or >>> Customer Support can disable lockfiles / disable ioctl in >>> Case they detect that they are runing on an OS / Kernal that >>> Does not support one or the other. >> >> Yes, this would be good I guess... Applications could offer >> configuration options to control that, maybe similarily as >> minicom. >> >> BTW, man minicom tells: >> >> *B - Lock file location >> On most systems This should be /usr/spool/uucp. >> Linux systems use /var/lock. If this directory >> does not exist, minicom will not attempt to use >> lockfiles. >> >> The statement `Linux systems use /var/lock' is interesting, does >> anyone know the source of this convention? >> >> oki, >> >> Steffen >> >> About Ingenico Throughout the world businesses rely on Ingenico for secure >> and expedient electronic transaction acceptance. Ingenico products leverage >> proven technology, established standards and unparalleled ergonomics to >> provide optimal reliability, versatility and usability. This comprehensive >> range of products is complemented by a global array of services and >> partnerships, enabling businesses in a number of vertical sectors to accept >> transactions anywhere their business takes them. www.ingenico.com This >> message may contain confidential and/or privileged information. If you are >> not the addressee or authorized to receive this for the addressee, you must >> not use, copy, disclose or take any action based on this message or any >> information herein. If you have received this message in error, please >> advise the sender immediately by reply e-mail and delete this message. >> Thank you for your cooperation. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0038.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0036.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0023.html From pboulton at pulsetracer.com Fri Apr 18 14:30:13 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Fri, 18 Apr 2008 13:30:13 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site Message-ID: <480904D5.1060307@pulsetracer.com> Hello, gentle serial porters. I have downloaded the zipped up binaries for use on Windows without Sun's CommAPI, but don't seem able to extract anything from the download. Go to main page, http://www.rxtx.org/ Click on Downloads I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) And I save it to disk. If I try and extract the files with WinZip, Winzip thinks the archive is corrupt. If I try using Windows Explorer, I am able to extract it into a single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than the original .zip. Any help would be much appreciated. Sincerely, Philip Boulton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080418/97d89793/attachment-0021.html From tjarvi at qbang.org Fri Apr 18 19:07:00 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 18 Apr 2008 19:07:00 -0600 (MDT) Subject: [Rxtx] Difficulty opening zip file at rxtx site In-Reply-To: <480904D5.1060307@pulsetracer.com> References: <480904D5.1060307@pulsetracer.com> Message-ID: On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org From pboulton at pulsetracer.com Sat Apr 19 12:46:26 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Sat, 19 Apr 2008 11:46:26 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site References: <480904D5.1060307@pulsetracer.com> Message-ID: <53DB7576450695419E09299104043761A78533@ZTGSERVER.ztg.local> I have been able to get my hands on the binaries, by going to the ftp directory /pub/rxtx at ftp.qbang.org,, and ftping the file rxtx-2.1-7-bins-r2.zip . This opens happily with Winzip, and extracts as the set of files that you describe below. I only experience the ill-formed archive problem by clicking the link on the rxtx.org Downloads page (http://rxtx.qbang.org/pub/rxtx/ rxtx-2.1-7-bins-r2.zip ). Not sure what to make of that. Philip Boulton ________________________________ From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Fri 4/18/2008 6:07 PM To: Philip Boulton Cc: rxtx at qbang.org Subject: Re: [Rxtx] Difficulty opening zip file at rxtx site On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080419/147923bb/attachment-0020.html From jlar310 at gmail.com Sat Apr 19 19:11:55 2008 From: jlar310 at gmail.com (Jeff Larsen) Date: Sat, 19 Apr 2008 20:11:55 -0500 Subject: [Rxtx] Moxa serial over Ethernet driver Message-ID: Hi all, I've been using javax.comm for years to communicate with a legacy radio data system. We want to migrate the java side of the system to a VMware Server virtual machine. We've had great success using Moxa DE-303 and 5610 serial over Ethernet appliances and virtual machines for running hylafax. The OS (Linux in this case) uses a kernel driver to communicate with the Moxa via a virtual serial port such as /dev/ttyr00. I want to do the same thing with javax.comm or gnu.io to connect to a virtual serial port. However I'm hitting road blocks everywhere. javax.comm for Linux sees the virtual port, but there are transmission errors. Tried Solaris too, but the Solaris Moxa drivers don't play nice with javax.comm because the driver uses /dev/pts/n instead of /dev/term/x. Next I tried RXTX on Linux, but I'm getting NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX on Solaris. Has anyone used RXTX with serial over Ethernet devices? Any hints on how to make it work? I know that I'm not completely off track because javax.comm does work with Moxa on a Windows platform, but that's just not an option for production deployment. -- Jeff From tjarvi at qbang.org Sat Apr 19 21:08:41 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 19 Apr 2008 21:08:41 -0600 (MDT) Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: yOn Sat, 19 Apr 2008, Jeff Larsen wrote: > Hi all, > > I've been using javax.comm for years to communicate with a legacy > radio data system. We want to migrate the java side of the system to a > VMware Server virtual machine. We've had great success using Moxa > DE-303 and 5610 serial over Ethernet appliances and virtual machines > for running hylafax. The OS (Linux in this case) uses a kernel driver > to communicate with the Moxa via a virtual serial port such as > /dev/ttyr00. > > I want to do the same thing with javax.comm or gnu.io to connect to a > virtual serial port. However I'm hitting road blocks everywhere. > javax.comm for Linux sees the virtual port, but there are transmission > errors. Tried Solaris too, but the Solaris Moxa drivers don't play > nice with javax.comm because the driver uses /dev/pts/n instead of > /dev/term/x. Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris. > > Has anyone used RXTX with serial over Ethernet devices? Any hints on > how to make it work? > > I know that I'm not completely off track because javax.comm does work > with Moxa on a Windows platform, but that's just not an option for > production deployment. > > Moxa should work under linux. There may be minor issues depending upon how complete the kernel driver is but I think it will work. One of the minor issues is /dev/ttyr00 is not enumerated. There are several work arounds documented with the source code and on the wiki. The easiest solution for testing purposes is to make a symbolic link from /dev/ttyr00 to a port that is enumerated such as /dev/ttyS129. You can later alter the rxtx source or use properties to change the enumerated ports. -- Trent Jarvi tjarvi at qbang.org From d.tonhofer at m-plify.com Sun Apr 20 03:33:30 2008 From: d.tonhofer at m-plify.com (David Tonhofer (M-PLIFY S.A.)) Date: Sun, 20 Apr 2008 11:33:30 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: <480B0DEA.5010908@m-plify.com> Jeff Larsen wrote: > Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris It might be that the Java side of RXTX does not recognize that portname. Trying modifying src/RXTXCommDriver.java as described in this case: http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card From ajmas at sympatico.ca Sun Apr 20 16:37:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Apr 2008 18:37:59 -0400 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <480B0DEA.5010908@m-plify.com> References: <480B0DEA.5010908@m-plify.com> Message-ID: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > Jeff Larsen wrote: >> Next I tried RXTX on Linux, but I'm getting >> NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX >> on Solaris > It might be that the Java side of RXTX does not recognize that > portname. > Trying modifying src/RXTXCommDriver.java as described in this case: > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card I wonder whether it would be worth allowing custom port prefixes as a system parameter? For example: gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" Andre From Martin.Oberhuber at windriver.com Tue Apr 22 12:34:36 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 22 Apr 2008 20:34:36 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> References: <480B0DEA.5010908@m-plify.com> <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE6485848056CD6CE@ism-mail03.corp.ad.wrs.com> Sounds like a great idea... I'm wondering how the "variable part" after the Prefixes could be specified though? What about allowing Regular Expression character Classes in the existing System Property for specifying ports: System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyS[0-9],ttyS[ABC],ttyUSB[0-9a-z]"); The set of allowed patterns would of course need to Be restricted compared to REGEX, because it must be A syntax that supports iterating over it. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Montag, 21. April 2008 00:38 > To: rxtx at qbang.org and Users > Subject: Re: [Rxtx] Moxa serial over Ethernet driver > > > On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > > Jeff Larsen wrote: > >> Next I tried RXTX on Linux, but I'm getting > >> NoSuchPortException connecting to /dev/ttyr00. I have yet > to try RXTX > >> on Solaris > > It might be that the Java side of RXTX does not recognize that > > portname. > > Trying modifying src/RXTXCommDriver.java as described in this case: > > > > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_ > SST-4P.2FLP_multiport_card > > I wonder whether it would be worth allowing custom port > prefixes as a > system parameter? For > example: > > gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Loi.TRAN at weatherford.com Tue Apr 22 13:10:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Tue, 22 Apr 2008 14:10:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled Message-ID: Hi, I'm currently using the Java RXTX API to interface to a serial port. The serial port is connected to a bridge board that communicates with our communications system running at 1.875 Mbps which is linked to an embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no flow control). I send a command to the embedded board through the serial-bridge board which then is relayed to the embedded board. The command sent asks the embedded board to dump a binary image. Here's where I'm hitting some problems. I've successfully done this is an integrated serial port from the laptop. The binary file that comes back is consistent on every attempt. When I use the application I've written to do the same thing with a USB-to-serial adapter, the image I get back is not the same as the image I receive through the USB-to-serial adapter is not consistent at all. A final thing is that when I use a terminal program to dump the binary image with the USB-serial adapter, the image is correct. Every time! What is the terminal program doing that's not being done in my application? My application is quite simple. Has anyone observed this behavior before? If you have, I'd like to know how you've gotten around this problem. Thanks, LT =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From tjarvi at qbang.org Tue Apr 22 21:11:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 22 Apr 2008 21:11:10 -0600 (MDT) Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org From Loi.TRAN at weatherford.com Wed Apr 23 08:35:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Wed, 23 Apr 2008 09:35:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: Thanks for all the responses. I finally tried something that worked consistently. I updated my Prolific driver and repeated my tests. It worked. If you're using the Prolific type USB-serial adapters, do no use the Prolific version 2.0.2.1 driver on Windows. Update it to the latest 2.0.2.8 version. Again, thanks for all the responses. LT -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Tuesday, April 22, 2008 10:11 PM To: TRAN, Loi X. Cc: rxtx at qbang.org Subject: Re: [Rxtx] Prolific USB - RXTX data mangled On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From Martin.Oberhuber at windriver.com Wed Apr 23 18:54:26 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 02:54:26 +0200 Subject: [Rxtx] RXTX port locking on Linux status? Message-ID: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Dear RXTX community, I'm wondering what the status is with RXTX locking serial ports on Linux? My understanding is that the mechanism used in 2.1-7r2 (lockfiles) is not really state of the art, and has lots of problems (e.g. missing permissions). There was an idea to migrate towards a Kernel syscall based solution for port locking. What's the status here? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/9878db9f/attachment-0016.html From tjarvi at qbang.org Wed Apr 23 20:32:24 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Apr 2008 20:32:24 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > Dear RXTX community, > > I'm wondering what the status is with RXTX locking > serial ports on Linux? > > My understanding is that the mechanism used in > 2.1-7r2 (lockfiles) is not really state of the art, and > has lots of problems (e.g. missing permissions). > > There was an idea to migrate towards a Kernel > syscall based solution for port locking. > > What's the status here? > Hi Martin, I'm in favor of deprecating the current FHS locking mechanism in favor of an IOCTL when available. I think it will be available on all the platforms but do not know for sure. The status is unchanged. I've had very few free cycles for such things. Feel free to take a stab at it if you have some time. I believe the IOCTL is used in the Mac OS X code already. I don't see any real backwards compatability issues and the IOCTL should just work. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Apr 24 06:14:06 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 14:14:06 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Thanks Trent. Problem is only that I'm really not at all Familiar with the C part of RXTX. If there Were anything I could do in Java for this, It would be easier for me.... ... Are there any C experts here on the list Who'd like to look at ioctl port locking For linux? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Donnerstag, 24. April 2008 04:32 > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > I'm wondering what the status is with RXTX locking > > serial ports on Linux? > > > > My understanding is that the mechanism used in > > 2.1-7r2 (lockfiles) is not really state of the art, and > > has lots of problems (e.g. missing permissions). > > > > There was an idea to migrate towards a Kernel > > syscall based solution for port locking. > > > > What's the status here? > > > > Hi Martin, > > I'm in favor of deprecating the current FHS locking mechanism > in favor of > an IOCTL when available. I think it will be available on all the > platforms but do not know for sure. > > The status is unchanged. I've had very few free cycles for > such things. > Feel free to take a stab at it if you have some time. I > believe the IOCTL > is used in the Mac OS X code already. > > I don't see any real backwards compatability issues and the > IOCTL should > just work. > > -- > Trent Jarvi > tjarvi at qbang.org > From sspies at sloc.de Thu Apr 24 07:15:36 2008 From: sspies at sloc.de (Sebastian Spies) Date: Thu, 24 Apr 2008 15:15:36 +0200 (CEST) Subject: [Rxtx] rxtx on gumstix: Interrupted system call In-Reply-To: <47FB7B20.7080504@sloc.de> References: <47FB7B20.7080504@sloc.de> Message-ID: <55445.130.83.139.205.1209042936.squirrel@ssl.sloc.de> Dear list, while porting rxtx to the gumstix, I found out, that select used in readArray in SerialImp.c might not work as expected. Maybe, because of missing TIOCSERGETLSR-support? select is often interrupted, so i wrote the following quick'n'dirty hack to make it work on gumstix: diff -Nur rxtx-2.1-7r2/src/SerialImp.c rxtx-2.1-7r2/src/SerialImp.c --- rxtx-2.1-7r2/src/SerialImp.c 2006-01-29 23:19:04.000000000 +0100 +++ rxtx-2.1-7r2-patched/src/SerialImp.c 2008-04-24 14:30:17.000000000 +0200 @@ -3380,7 +3381,7 @@ JNIEXPORT jint JNICALL RXTXPort(readArray)( JNIEnv *env, jobject jobj, jbyteArray jbarray, jint offset, jint length ) { - int bytes; + int bytes = 0; jbyte *body; /* char msg[80]; */ int fd = get_java_var( env, jobj, "fd", "I" ); @@ -3397,9 +3398,18 @@ "readArray", "Invalid length" ); return -1; } - body = (*env)->GetByteArrayElements( env, jbarray, 0 ); - bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ - (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + while(1 > bytes) + { + body = (*env)->GetByteArrayElements( env, jbarray, 0 ); + bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ + (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + // quick'n'dirty - SSP + report (" trying again... \n"); + errno = 0; + } + if( bytes < 0 ) { report( "RXTXPort:readArray bytes < 0" ); LEAVE( "RXTXPort:readArray" ); > Hey, > > I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use > RXTXPort$SerialInputStream.read(), then I get the following Exception. I > did not yet figure out which system call is interrupted as strace > produces loads of output. > > Any help would be very appreciated. Thanks in advance. > Sebastian > > > [java] java.io.IOException: Interrupted system call in readArray > [java] at gnu.io.RXTXPort.readArray(Native Method) > [java] at > gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) > [java] at > java.io.FilterInputStream.read(FilterInputStream.java:189) > [java] at > java.io.BufferedInputStream.refill(BufferedInputStream.java:371) > [java] at > java.io.BufferedInputStream.read(BufferedInputStream.java:229) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) > [java] at > com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) > > -- > Sebastian Spies > > mail: sspies at sloc.de > > > > From fire_baptized at hotmail.com Thu Apr 24 18:27:48 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Thu, 24 Apr 2008 20:27:48 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hello I am having a problem with the serial device connecting (software wise) to the serial port. However I have a test program and it seems to work just fine in that environment - and it doesnt use GUI. The error I am getting is : PortNotFoundException Now the way I have it setup in the GUI environment is that once the user pushes a JButton the program connects using this class: protected void establishConnection() { try { portId = CommPortIdentifier.getPortIdentifier("COM3"); System.out.println("Establishing connction....."); messages[0] = "\nEstablishing connction.....\n"; } catch ( NoSuchPortException noport) { System.out.println("Port not found: "+ noport); messages[0] = "Port not found: "+ noport+"\n"; } try { serialPort = (SerialPort) portId.open("serial", 50); System.out.println("Port has been found."); messages[1] = "Port has been found.\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[1] = "" +usedport; } try { serialPort = (SerialPort) portId.open("serial", 50); messages[2] = "Connecting to COM3 on port 50....\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; } try { serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); System.out.println("Esablishing the transfer rate settings for COM3."); messages[3] = "Esablishing the transfer rate settings for COM3.\n"; } catch (UnsupportedCommOperationException nosupcom) { System.out.println(nosupcom); System.out.println("The tranfer rate could not be esblished on COM3."); messages[3] = "The tranfer rate could not be esblished on COM3.\n"; } System.out.println(serialPort.getFlowControlMode()); messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; //sendDataOut(buffer[3],buffer[4]); } I need all the data in this method (and all the string values in this method) to be printed out on a JTextArea. I wont do me any good if not all the text is printed on a JTextArea in another class. So I have the text printing the JTextArea correctly, but everytime the JButton is activated - it gives me that error message. I did add a disconnect button that is supposed to call the serialPort.close(). _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/273fd4ec/attachment-0015.html From tjarvi at qbang.org Thu Apr 24 21:54:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Apr 2008 21:54:10 -0600 (MDT) Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > Hello I am having a problem with the serial device connecting (software > wise) to the serial port. However I have a test program and it seems to > work just fine in that environment - and it doesnt use GUI. The error I > am getting is : PortNotFoundException Now the way I have it setup in the > GUI environment is that once the user pushes a JButton the program > connects using this class: > > protected void establishConnection() { > try { > portId = CommPortIdentifier.getPortIdentifier("COM3"); > System.out.println("Establishing connction....."); > messages[0] = "\nEstablishing connction.....\n"; > } > catch ( NoSuchPortException noport) { > System.out.println("Port not found: "+ noport); > messages[0] = "Port not found: "+ noport+"\n"; > } > try { > serialPort = (SerialPort) portId.open("serial", 50); > System.out.println("Port has been found."); > messages[1] = "Port has been found.\n"; > } > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[1] = "" +usedport; > } ================================================================= > try { > serialPort = (SerialPort) portId.open("serial", 50); > messages[2] = "Connecting to COM3 on port 50....\n"; > } ================================================================== > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > } > try { > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > System.out.println("Esablishing the transfer rate settings for COM3."); > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > } > catch (UnsupportedCommOperationException nosupcom) { > System.out.println(nosupcom); > System.out.println("The tranfer rate could not be esblished on COM3."); > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > } > System.out.println(serialPort.getFlowControlMode()); > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > //sendDataOut(buffer[3],buffer[4]); > } > > I need all the data in this method (and all the string values in this > method) to be printed out on a JTextArea. I wont do me any good if not > all the text is printed on a JTextArea in another class. So I have the > text printing the JTextArea correctly, but everytime the JButton is > activated - it gives me that error message. I did add a disconnect > button that is supposed to call the serialPort.close(). > The open code used twice is going to throw an exception. It may be that you catch the exception above this code and print a confusing message? A common mistake is people will accidently run two copies of their program. The first instance of the program will open the port and prevent enumeration (finding the port) in the second instance of the program. As an example, you may be running your text based application which is preventing the GUI from seeing the port. Enumeration is done by trying to open the port. If the port is open, Enumeration fails. -- Trent Jarvi tjarvi at qbang.org From fire_baptized at hotmail.com Thu Apr 24 22:32:05 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 00:32:05 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Wow - thanks dude what a dumb thing for me to not catch..... now here is the current problem - right now I am trying to output data again one is with the test program - and it seems that serialPort.setRTS(true); is throwing an exceptions there - now if I show this code please bare in mind that I am only testing - the code is kinda sloppy in my mind - but if I can figure out why calling this function is throwing an exception then maybe I can figure out why my GUI application is getting the same null pointer exceptions when try to send out the data stream. FYI Trent this email is not directed towards you - anyone can jump in on this public static void main(String args[]) { byte[] b = new byte[64]; int keyinput = 0 ; byte x = 0; byte y = 0; PortTesting1 testports = new PortTesting1(); try { joyskoro = Joystick.createInstance(); } catch (IOException ioexc) { System.out.println("There is an input/output problem: " + ioexc); } while (true) { joyskoro.poll(); b[0] = ((byte) -(10 * joyskoro.getY())); b[1] = ((byte) (10 * joyskoro.getX())); System.out.println("The 3rd byte is: " +b[0]); System.out.println("The 4rd byte is: " +b[1]); serialPort.setRTS(true); // HERE IS WHERE THE PROBLEM IS !!!!!!! ON THIS LINE but if I dont have it active in my program the Bluetooth device (that is System.out.println("Ready to send :-) !"); //connected to the serial port does not send out data!!!!! if (joyskoro.isButtonDown(joyskoro.BUTTON10)) { System.out.println("Connection terminated."); serialPort.close(); break; } if (joyskoro.isButtonDown(joyskoro.BUTTON2)) { boolean flag = true; //reading from key input from the keyboard System.out.println("Please input a command: "); while (flag) { try { keyinput = System.in.read(); } catch (IOException ioexc) {/*there is no need to put * anything here */ } if((char)keyinput=='w') { pushIt((byte)85); } if((char)keyinput=='s') { pushIt((byte)84); } if((char)keyinput=='a') { pushIt((byte)83); } if((char)keyinput=='d') { pushIt((byte)82); } if((char)keyinput=='q') { pushIt((byte)89); } if((char)keyinput=='\t') { //this stop reading input from the keyboard flag = false; } } and help anyways here is the block of code that throwing an exception for the test program: > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/5c8f7d68/attachment-0015.html From fire_baptized at hotmail.com Fri Apr 25 07:59:53 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 09:59:53 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Are there any examples of how to push out data? As in using input and output streams - if I can compare code maybe I can see where this is causing a problem. I have a byte array that I am pushing out data. I keep getting null pointer exceptions every where I turn. > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/22228ab6/attachment-0014.html From ajmas at sympatico.ca Sat Apr 26 07:37:09 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 26 Apr 2008 09:37:09 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hi, On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote: > > Are there any examples of how to push out data? As in using input > and output streams - if I can compare code maybe I can see where > this is causing a problem. I have a byte array that I am pushing > out data. I keep getting null pointer exceptions every where I turn. > There are some examples here that might be of help: http://rxtx.qbang.org/wiki/index.php/Examples Andre From fire_baptized at hotmail.com Sat Apr 26 20:13:54 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Sat, 26 Apr 2008 22:13:54 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: looked at those....yep didnt help - I need to push out data with GUI and not get a null pointer exception everytime I try. > CC: rxtx at qbang.org> From: ajmas at sympatico.ca> To: fire_baptized at hotmail.com> Subject: Re: [Rxtx] Serial Problems with Gui.....> Date: Sat, 26 Apr 2008 09:37:09 -0400> > Hi,> > > On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote:> >> > Are there any examples of how to push out data? As in using input > > and output streams - if I can compare code maybe I can see where > > this is causing a problem. I have a byte array that I am pushing > > out data. I keep getting null pointer exceptions every where I turn.> >> > There are some examples here that might be of help:> > http://rxtx.qbang.org/wiki/index.php/Examples> > Andre _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080426/09f95b41/attachment-0013.html From michael.erskine at ketech.com Mon Apr 28 02:47:22 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 28 Apr 2008 09:47:22 +0100 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D426EF3CBBC5@no-sv-03.ketech.local> Jesrael D. Summerhill wrote: > looked at those....yep didnt help - I need to push out data with GUI and > not get a null pointer exception everytime I try. So it seems pretty obvious that your code needs to check for nulls wherever one may occur and report what's happening. Alternatively, catch the npe and display the stack trace. Then you can fix your code so it doesn't try to work with something that ain't there. Regards, Michael Erskine. From scldad at sdc.com.au Mon Apr 28 03:58:34 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Mon, 28 Apr 2008 19:28:34 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Message-ID: <200804281928.34454.scldad@sdc.com.au> Has anybody done any design work on this? The first thing that springs to mind is that we still need to check for lock files because other apps tend to use that approach even if we go to ioctl. Cheers, Stephen Davies On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > Thanks Trent. > > Problem is only that I'm really not at all > Familiar with the C part of RXTX. If there > Were anything I could do in Java for this, > It would be easier for me.... > > ... Are there any C experts here on the list > Who'd like to look at ioctl port locking > For linux? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > -----Original Message----- > > From: Trent Jarvi [mailto:tjarvi at qbang.org] > > Sent: Donnerstag, 24. April 2008 04:32 > > To: Oberhuber, Martin > > Cc: rxtx at qbang.org > > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > > > I'm wondering what the status is with RXTX locking > > > serial ports on Linux? > > > > > > My understanding is that the mechanism used in > > > 2.1-7r2 (lockfiles) is not really state of the art, and > > > has lots of problems (e.g. missing permissions). > > > > > > There was an idea to migrate towards a Kernel > > > syscall based solution for port locking. > > > > > > What's the status here? > > > > Hi Martin, > > > > I'm in favor of deprecating the current FHS locking mechanism > > in favor of > > an IOCTL when available. I think it will be available on all the > > platforms but do not know for sure. > > > > The status is unchanged. I've had very few free cycles for > > such things. > > Feel free to take a stab at it if you have some time. I > > believe the IOCTL > > is used in the Mac OS X code already. > > > > I don't see any real backwards compatability issues and the > > IOCTL should > > just work. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Mon Apr 28 04:21:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 28 Apr 2008 04:21:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804281928.34454.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: I don't think there would need to be any architectural changes. A couple ifdefs and minor changes in the current code should be enough. Proposal: FHS/UUCP locks: continue to respect them, try to create them but do not error if the IOCTL is supported. (But does the IOCTL being defined mean it will work?) Enumeration: Do not assert the IOCTL while opening. Serial.open: assert the IOCTL after open. Continue to use locks as described above after asserting the IOCTL. If the IOCTL is defined but not working, handle it here. Failure cases include the IOCTL is not supported and the port is already locked. On Mon, 28 Apr 2008, Stephen Davies wrote: > Has anybody done any design work on this? > The first thing that springs to mind is that we still need to check for lock > files because other apps tend to use that approach even if we go to ioctl. > > Cheers, > Stephen Davies > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: >> Thanks Trent. >> >> Problem is only that I'm really not at all >> Familiar with the C part of RXTX. If there >> Were anything I could do in Java for this, >> It would be easier for me.... >> >> ... Are there any C experts here on the list >> Who'd like to look at ioctl port locking >> For linux? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >>> -----Original Message----- >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] >>> Sent: Donnerstag, 24. April 2008 04:32 >>> To: Oberhuber, Martin >>> Cc: rxtx at qbang.org >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? >>> >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: >>>> Dear RXTX community, >>>> >>>> I'm wondering what the status is with RXTX locking >>>> serial ports on Linux? >>>> >>>> My understanding is that the mechanism used in >>>> 2.1-7r2 (lockfiles) is not really state of the art, and >>>> has lots of problems (e.g. missing permissions). >>>> >>>> There was an idea to migrate towards a Kernel >>>> syscall based solution for port locking. >>>> >>>> What's the status here? >>> >>> Hi Martin, >>> >>> I'm in favor of deprecating the current FHS locking mechanism >>> in favor of >>> an IOCTL when available. I think it will be available on all the >>> platforms but do not know for sure. >>> >>> The status is unchanged. I've had very few free cycles for >>> such things. >>> Feel free to take a stab at it if you have some time. I >>> believe the IOCTL >>> is used in the Mac OS X code already. >>> >>> I don't see any real backwards compatability issues and the >>> IOCTL should >>> just work. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Tue Apr 29 12:04:04 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Apr 2008 20:04:04 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Hi all, The biggest problem that I have seen with lockfiles on Linux At least is, that it seems there is no standard with respect To the folder in which they should be created. Also, many Distributions seem to set up file system permissions in such A way that writing to the lockfile folder is not allowed for The normal user -- that's why we stopped using lockfiles In our commercial product. If we are to still respect lockfiles, we first need to Understand where we are expected to look for them. Does Anybody have any insight what variants of lockfile folder Schema exist out there in the wild? Some apps like minicom Seem to even allow users to manually specify a lockfile Folder of their choice. Because of the difficulty finding the right lockfile folder, And because of the inherent risk of thinking that something Might be locked while it actually isn't, I'd suggest that RXTX should have a "soft-off" feature that allows disabling ALL Lockfile checks at runtime without recompiling the native Sharedlibs. Trent - I like your strategy outline, but I think that it Needs to be configurable by the client such that users and/or Customer Support can disable lockfiles / disable ioctl in Case they detect that they are runing on an OS / Kernal that Does not support one or the other. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Montag, 28. April 2008 12:22 > To: Stephen Davies > Cc: rxtx at qbang.org; Oberhuber, Martin; Trent Jarvi > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > I don't think there would need to be any architectural > changes. A couple > ifdefs and minor changes in the current code should be enough. > > Proposal: > > FHS/UUCP locks: > continue to respect them, try to create them but do not error if > the IOCTL is supported. (But does the IOCTL being defined mean > it will work?) > Enumeration: > Do not assert the IOCTL while opening. > Serial.open: > assert the IOCTL after open. Continue to use locks as described > above after asserting the IOCTL. If the IOCTL is defined but > not working, handle it here. Failure cases include the IOCTL > is not supported and the port is already locked. > > On Mon, 28 Apr 2008, Stephen Davies wrote: > > > Has anybody done any design work on this? > > The first thing that springs to mind is that we still need > to check for lock > > files because other apps tend to use that approach even if > we go to ioctl. > > > > Cheers, > > Stephen Davies > > > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > >> Thanks Trent. > >> > >> Problem is only that I'm really not at all > >> Familiar with the C part of RXTX. If there > >> Were anything I could do in Java for this, > >> It would be easier for me.... > >> > >> ... Are there any C experts here on the list > >> Who'd like to look at ioctl port locking > >> For linux? > >> > >> Thanks, > >> -- > >> Martin Oberhuber, Senior Member of Technical Staff, Wind River > >> Target Management Project Lead, DSDP PMC Member > >> http://www.eclipse.org/dsdp/tm > >> > >>> -----Original Message----- > >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] > >>> Sent: Donnerstag, 24. April 2008 04:32 > >>> To: Oberhuber, Martin > >>> Cc: rxtx at qbang.org > >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? > >>> > >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > >>>> Dear RXTX community, > >>>> > >>>> I'm wondering what the status is with RXTX locking > >>>> serial ports on Linux? > >>>> > >>>> My understanding is that the mechanism used in > >>>> 2.1-7r2 (lockfiles) is not really state of the art, and > >>>> has lots of problems (e.g. missing permissions). > >>>> > >>>> There was an idea to migrate towards a Kernel > >>>> syscall based solution for port locking. > >>>> > >>>> What's the status here? > >>> > >>> Hi Martin, > >>> > >>> I'm in favor of deprecating the current FHS locking mechanism > >>> in favor of > >>> an IOCTL when available. I think it will be available on all the > >>> platforms but do not know for sure. > >>> > >>> The status is unchanged. I've had very few free cycles for > >>> such things. > >>> Feel free to take a stab at it if you have some time. I > >>> believe the IOCTL > >>> is used in the Mac OS X code already. > >>> > >>> I don't see any real backwards compatability issues and the > >>> IOCTL should > >>> just work. > >>> > >>> -- > >>> Trent Jarvi > >>> tjarvi at qbang.org > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > From Steffen.DETTMER at ingenico.com Tue Apr 29 13:34:44 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 29 Apr 2008 21:34:44 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Message-ID: <20080429193444.GU2928@elberon.bln.de.ingenico.com> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > The biggest problem that I have seen with lockfiles on Linux > At least is, that it seems there is no standard with respect > To the folder in which they should be created. Also, many > Distributions seem to set up file system permissions in such > A way that writing to the lockfile folder is not allowed for > The normal user -- that's why we stopped using lockfiles > In our commercial product. It seems it depends on the expectations. I consider it as a feature that by default a linux user cannot access serial ports. Maybe root connected a modem (can produce phone bills) or even some serial card reader, maybe with the web servers key pair. I would expect that by default a user cannot open the serial port because of insufficient permissions on the device file. I would expect this on other unices as well (but I don't know it). For windows I think it should be similar but not impacting so much in practice, because often windows users work with big permissions on a somewhat high priviledge level or even Administrator. > If we are to still respect lockfiles, we first need to > Understand where we are expected to look for them. Does > Anybody have any insight what variants of lockfile folder > Schema exist out there in the wild? Some apps like minicom > Seem to even allow users to manually specify a lockfile > Folder of their choice. At least my (ancient) minicom does not allow the user to change this option, it is displayed but read-only, but root is allowed to change it. > Because of the difficulty finding the right lockfile folder, > And because of the inherent risk of thinking that something > Might be locked while it actually isn't, I'd suggest that > RXTX should have a "soft-off" feature that allows disabling > ALL Lockfile checks at runtime without recompiling the native > Sharedlibs. sounds very reasonable, yes... and as admin I would not wish that users could skip such locking because they do things wrong by default ;) (in the end I guess that is related to the dilemma, that hotplug/user-owned-periphery and multi-user systems simply conflict) > Trent - I like your strategy outline, but I think that it > Needs to be configurable by the client such that users and/or > Customer Support can disable lockfiles / disable ioctl in > Case they detect that they are runing on an OS / Kernal that > Does not support one or the other. Yes, this would be good I guess... Applications could offer configuration options to control that, maybe similarily as minicom. BTW, man minicom tells: *B - Lock file location On most systems This should be /usr/spool/uucp. Linux systems use /var/lock. If this directory does not exist, minicom will not attempt to use lockfiles. The statement `Linux systems use /var/lock' is interesting, does anyone know the source of this convention? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Tue Apr 29 16:11:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Apr 2008 16:11:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? These details are outlined in the Filesystem Hierarchy Standard (FHS). http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLOCKLOCKFILES -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Tue Apr 29 18:58:09 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Wed, 30 Apr 2008 10:28:09 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: <200804301028.09307.scldad@sdc.com.au> I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is the same. Any ideas as to how to handle this? Stephen On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: > * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > > The biggest problem that I have seen with lockfiles on Linux > > At least is, that it seems there is no standard with respect > > To the folder in which they should be created. Also, many > > Distributions seem to set up file system permissions in such > > A way that writing to the lockfile folder is not allowed for > > The normal user -- that's why we stopped using lockfiles > > In our commercial product. > > It seems it depends on the expectations. I consider it as a > feature that by default a linux user cannot access serial ports. > Maybe root connected a modem (can produce phone bills) or even > some serial card reader, maybe with the web servers key pair. > > I would expect that by default a user cannot open the serial port > because of insufficient permissions on the device file. I would > expect this on other unices as well (but I don't know it). > > For windows I think it should be similar but not impacting so > much in practice, because often windows users work with big > permissions on a somewhat high priviledge level or even > Administrator. > > > If we are to still respect lockfiles, we first need to > > Understand where we are expected to look for them. Does > > Anybody have any insight what variants of lockfile folder > > Schema exist out there in the wild? Some apps like minicom > > Seem to even allow users to manually specify a lockfile > > Folder of their choice. > > At least my (ancient) minicom does not allow the user to change > this option, it is displayed but read-only, but root is allowed > to change it. > > > Because of the difficulty finding the right lockfile folder, > > And because of the inherent risk of thinking that something > > Might be locked while it actually isn't, I'd suggest that > > RXTX should have a "soft-off" feature that allows disabling > > ALL Lockfile checks at runtime without recompiling the native > > Sharedlibs. > > sounds very reasonable, yes... > and as admin I would not wish that users could skip such > locking because they do things wrong by default ;) > > (in the end I guess that is related to the dilemma, that > hotplug/user-owned-periphery and multi-user systems simply > conflict) > > > Trent - I like your strategy outline, but I think that it > > Needs to be configurable by the client such that users and/or > > Customer Support can disable lockfiles / disable ioctl in > > Case they detect that they are runing on an OS / Kernal that > > Does not support one or the other. > > Yes, this would be good I guess... Applications could offer > configuration options to control that, maybe similarily as > minicom. > > BTW, man minicom tells: > > *B - Lock file location > On most systems This should be /usr/spool/uucp. > Linux systems use /var/lock. If this directory > does not exist, minicom will not attempt to use > lockfiles. > > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure > and expedient electronic transaction acceptance. Ingenico products leverage > proven technology, established standards and unparalleled ergonomics to > provide optimal reliability, versatility and usability. This comprehensive > range of products is complemented by a global array of services and > partnerships, enabling businesses in a number of vertical sectors to accept > transactions anywhere their business takes them. www.ingenico.com This > message may contain confidential and/or privileged information. If you are > not the addressee or authorized to receive this for the addressee, you must > not use, copy, disclose or take any action based on this message or any > information herein. If you have received this message in error, please > advise the sender immediately by reply e-mail and delete this message. > Thank you for your cooperation. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Wed Apr 30 19:30:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 30 Apr 2008 19:30:51 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804301028.09307.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> <200804301028.09307.scldad@sdc.com.au> Message-ID: Hi Stephen, I suspect ioctl/TIOCEXCL open/O_EXCL would do the job. Mac uses TIOCEXCL and it is POSIX. We use O_EXCL for lockfiles on Linux already. On Wed, 30 Apr 2008, Stephen Davies wrote: > I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is > the same. > > Any ideas as to how to handle this? > > Stephen > > > On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: >> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: >>> The biggest problem that I have seen with lockfiles on Linux >>> At least is, that it seems there is no standard with respect >>> To the folder in which they should be created. Also, many >>> Distributions seem to set up file system permissions in such >>> A way that writing to the lockfile folder is not allowed for >>> The normal user -- that's why we stopped using lockfiles >>> In our commercial product. >> >> It seems it depends on the expectations. I consider it as a >> feature that by default a linux user cannot access serial ports. >> Maybe root connected a modem (can produce phone bills) or even >> some serial card reader, maybe with the web servers key pair. >> >> I would expect that by default a user cannot open the serial port >> because of insufficient permissions on the device file. I would >> expect this on other unices as well (but I don't know it). >> >> For windows I think it should be similar but not impacting so >> much in practice, because often windows users work with big >> permissions on a somewhat high priviledge level or even >> Administrator. >> >>> If we are to still respect lockfiles, we first need to >>> Understand where we are expected to look for them. Does >>> Anybody have any insight what variants of lockfile folder >>> Schema exist out there in the wild? Some apps like minicom >>> Seem to even allow users to manually specify a lockfile >>> Folder of their choice. >> >> At least my (ancient) minicom does not allow the user to change >> this option, it is displayed but read-only, but root is allowed >> to change it. >> >>> Because of the difficulty finding the right lockfile folder, >>> And because of the inherent risk of thinking that something >>> Might be locked while it actually isn't, I'd suggest that >>> RXTX should have a "soft-off" feature that allows disabling >>> ALL Lockfile checks at runtime without recompiling the native >>> Sharedlibs. >> >> sounds very reasonable, yes... >> and as admin I would not wish that users could skip such >> locking because they do things wrong by default ;) >> >> (in the end I guess that is related to the dilemma, that >> hotplug/user-owned-periphery and multi-user systems simply >> conflict) >> >>> Trent - I like your strategy outline, but I think that it >>> Needs to be configurable by the client such that users and/or >>> Customer Support can disable lockfiles / disable ioctl in >>> Case they detect that they are runing on an OS / Kernal that >>> Does not support one or the other. >> >> Yes, this would be good I guess... Applications could offer >> configuration options to control that, maybe similarily as >> minicom. >> >> BTW, man minicom tells: >> >> *B - Lock file location >> On most systems This should be /usr/spool/uucp. >> Linux systems use /var/lock. If this directory >> does not exist, minicom will not attempt to use >> lockfiles. >> >> The statement `Linux systems use /var/lock' is interesting, does >> anyone know the source of this convention? >> >> oki, >> >> Steffen >> >> About Ingenico Throughout the world businesses rely on Ingenico for secure >> and expedient electronic transaction acceptance. Ingenico products leverage >> proven technology, established standards and unparalleled ergonomics to >> provide optimal reliability, versatility and usability. This comprehensive >> range of products is complemented by a global array of services and >> partnerships, enabling businesses in a number of vertical sectors to accept >> transactions anywhere their business takes them. www.ingenico.com This >> message may contain confidential and/or privileged information. If you are >> not the addressee or authorized to receive this for the addressee, you must >> not use, copy, disclose or take any action based on this message or any >> information herein. If you have received this message in error, please >> advise the sender immediately by reply e-mail and delete this message. >> Thank you for your cooperation. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0039.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0037.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0024.html From pboulton at pulsetracer.com Fri Apr 18 14:30:13 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Fri, 18 Apr 2008 13:30:13 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site Message-ID: <480904D5.1060307@pulsetracer.com> Hello, gentle serial porters. I have downloaded the zipped up binaries for use on Windows without Sun's CommAPI, but don't seem able to extract anything from the download. Go to main page, http://www.rxtx.org/ Click on Downloads I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) And I save it to disk. If I try and extract the files with WinZip, Winzip thinks the archive is corrupt. If I try using Windows Explorer, I am able to extract it into a single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than the original .zip. Any help would be much appreciated. Sincerely, Philip Boulton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080418/97d89793/attachment-0022.html From tjarvi at qbang.org Fri Apr 18 19:07:00 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 18 Apr 2008 19:07:00 -0600 (MDT) Subject: [Rxtx] Difficulty opening zip file at rxtx site In-Reply-To: <480904D5.1060307@pulsetracer.com> References: <480904D5.1060307@pulsetracer.com> Message-ID: On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org From pboulton at pulsetracer.com Sat Apr 19 12:46:26 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Sat, 19 Apr 2008 11:46:26 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site References: <480904D5.1060307@pulsetracer.com> Message-ID: <53DB7576450695419E09299104043761A78533@ZTGSERVER.ztg.local> I have been able to get my hands on the binaries, by going to the ftp directory /pub/rxtx at ftp.qbang.org,, and ftping the file rxtx-2.1-7-bins-r2.zip . This opens happily with Winzip, and extracts as the set of files that you describe below. I only experience the ill-formed archive problem by clicking the link on the rxtx.org Downloads page (http://rxtx.qbang.org/pub/rxtx/ rxtx-2.1-7-bins-r2.zip ). Not sure what to make of that. Philip Boulton ________________________________ From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Fri 4/18/2008 6:07 PM To: Philip Boulton Cc: rxtx at qbang.org Subject: Re: [Rxtx] Difficulty opening zip file at rxtx site On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080419/147923bb/attachment-0021.html From jlar310 at gmail.com Sat Apr 19 19:11:55 2008 From: jlar310 at gmail.com (Jeff Larsen) Date: Sat, 19 Apr 2008 20:11:55 -0500 Subject: [Rxtx] Moxa serial over Ethernet driver Message-ID: Hi all, I've been using javax.comm for years to communicate with a legacy radio data system. We want to migrate the java side of the system to a VMware Server virtual machine. We've had great success using Moxa DE-303 and 5610 serial over Ethernet appliances and virtual machines for running hylafax. The OS (Linux in this case) uses a kernel driver to communicate with the Moxa via a virtual serial port such as /dev/ttyr00. I want to do the same thing with javax.comm or gnu.io to connect to a virtual serial port. However I'm hitting road blocks everywhere. javax.comm for Linux sees the virtual port, but there are transmission errors. Tried Solaris too, but the Solaris Moxa drivers don't play nice with javax.comm because the driver uses /dev/pts/n instead of /dev/term/x. Next I tried RXTX on Linux, but I'm getting NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX on Solaris. Has anyone used RXTX with serial over Ethernet devices? Any hints on how to make it work? I know that I'm not completely off track because javax.comm does work with Moxa on a Windows platform, but that's just not an option for production deployment. -- Jeff From tjarvi at qbang.org Sat Apr 19 21:08:41 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 19 Apr 2008 21:08:41 -0600 (MDT) Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: yOn Sat, 19 Apr 2008, Jeff Larsen wrote: > Hi all, > > I've been using javax.comm for years to communicate with a legacy > radio data system. We want to migrate the java side of the system to a > VMware Server virtual machine. We've had great success using Moxa > DE-303 and 5610 serial over Ethernet appliances and virtual machines > for running hylafax. The OS (Linux in this case) uses a kernel driver > to communicate with the Moxa via a virtual serial port such as > /dev/ttyr00. > > I want to do the same thing with javax.comm or gnu.io to connect to a > virtual serial port. However I'm hitting road blocks everywhere. > javax.comm for Linux sees the virtual port, but there are transmission > errors. Tried Solaris too, but the Solaris Moxa drivers don't play > nice with javax.comm because the driver uses /dev/pts/n instead of > /dev/term/x. Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris. > > Has anyone used RXTX with serial over Ethernet devices? Any hints on > how to make it work? > > I know that I'm not completely off track because javax.comm does work > with Moxa on a Windows platform, but that's just not an option for > production deployment. > > Moxa should work under linux. There may be minor issues depending upon how complete the kernel driver is but I think it will work. One of the minor issues is /dev/ttyr00 is not enumerated. There are several work arounds documented with the source code and on the wiki. The easiest solution for testing purposes is to make a symbolic link from /dev/ttyr00 to a port that is enumerated such as /dev/ttyS129. You can later alter the rxtx source or use properties to change the enumerated ports. -- Trent Jarvi tjarvi at qbang.org From d.tonhofer at m-plify.com Sun Apr 20 03:33:30 2008 From: d.tonhofer at m-plify.com (David Tonhofer (M-PLIFY S.A.)) Date: Sun, 20 Apr 2008 11:33:30 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: <480B0DEA.5010908@m-plify.com> Jeff Larsen wrote: > Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris It might be that the Java side of RXTX does not recognize that portname. Trying modifying src/RXTXCommDriver.java as described in this case: http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card From ajmas at sympatico.ca Sun Apr 20 16:37:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Apr 2008 18:37:59 -0400 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <480B0DEA.5010908@m-plify.com> References: <480B0DEA.5010908@m-plify.com> Message-ID: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > Jeff Larsen wrote: >> Next I tried RXTX on Linux, but I'm getting >> NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX >> on Solaris > It might be that the Java side of RXTX does not recognize that > portname. > Trying modifying src/RXTXCommDriver.java as described in this case: > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card I wonder whether it would be worth allowing custom port prefixes as a system parameter? For example: gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" Andre From Martin.Oberhuber at windriver.com Tue Apr 22 12:34:36 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 22 Apr 2008 20:34:36 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> References: <480B0DEA.5010908@m-plify.com> <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE6485848056CD6CE@ism-mail03.corp.ad.wrs.com> Sounds like a great idea... I'm wondering how the "variable part" after the Prefixes could be specified though? What about allowing Regular Expression character Classes in the existing System Property for specifying ports: System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyS[0-9],ttyS[ABC],ttyUSB[0-9a-z]"); The set of allowed patterns would of course need to Be restricted compared to REGEX, because it must be A syntax that supports iterating over it. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Montag, 21. April 2008 00:38 > To: rxtx at qbang.org and Users > Subject: Re: [Rxtx] Moxa serial over Ethernet driver > > > On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > > Jeff Larsen wrote: > >> Next I tried RXTX on Linux, but I'm getting > >> NoSuchPortException connecting to /dev/ttyr00. I have yet > to try RXTX > >> on Solaris > > It might be that the Java side of RXTX does not recognize that > > portname. > > Trying modifying src/RXTXCommDriver.java as described in this case: > > > > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_ > SST-4P.2FLP_multiport_card > > I wonder whether it would be worth allowing custom port > prefixes as a > system parameter? For > example: > > gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Loi.TRAN at weatherford.com Tue Apr 22 13:10:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Tue, 22 Apr 2008 14:10:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled Message-ID: Hi, I'm currently using the Java RXTX API to interface to a serial port. The serial port is connected to a bridge board that communicates with our communications system running at 1.875 Mbps which is linked to an embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no flow control). I send a command to the embedded board through the serial-bridge board which then is relayed to the embedded board. The command sent asks the embedded board to dump a binary image. Here's where I'm hitting some problems. I've successfully done this is an integrated serial port from the laptop. The binary file that comes back is consistent on every attempt. When I use the application I've written to do the same thing with a USB-to-serial adapter, the image I get back is not the same as the image I receive through the USB-to-serial adapter is not consistent at all. A final thing is that when I use a terminal program to dump the binary image with the USB-serial adapter, the image is correct. Every time! What is the terminal program doing that's not being done in my application? My application is quite simple. Has anyone observed this behavior before? If you have, I'd like to know how you've gotten around this problem. Thanks, LT =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From tjarvi at qbang.org Tue Apr 22 21:11:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 22 Apr 2008 21:11:10 -0600 (MDT) Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org From Loi.TRAN at weatherford.com Wed Apr 23 08:35:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Wed, 23 Apr 2008 09:35:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: Thanks for all the responses. I finally tried something that worked consistently. I updated my Prolific driver and repeated my tests. It worked. If you're using the Prolific type USB-serial adapters, do no use the Prolific version 2.0.2.1 driver on Windows. Update it to the latest 2.0.2.8 version. Again, thanks for all the responses. LT -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Tuesday, April 22, 2008 10:11 PM To: TRAN, Loi X. Cc: rxtx at qbang.org Subject: Re: [Rxtx] Prolific USB - RXTX data mangled On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From Martin.Oberhuber at windriver.com Wed Apr 23 18:54:26 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 02:54:26 +0200 Subject: [Rxtx] RXTX port locking on Linux status? Message-ID: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Dear RXTX community, I'm wondering what the status is with RXTX locking serial ports on Linux? My understanding is that the mechanism used in 2.1-7r2 (lockfiles) is not really state of the art, and has lots of problems (e.g. missing permissions). There was an idea to migrate towards a Kernel syscall based solution for port locking. What's the status here? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/9878db9f/attachment-0017.html From tjarvi at qbang.org Wed Apr 23 20:32:24 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Apr 2008 20:32:24 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > Dear RXTX community, > > I'm wondering what the status is with RXTX locking > serial ports on Linux? > > My understanding is that the mechanism used in > 2.1-7r2 (lockfiles) is not really state of the art, and > has lots of problems (e.g. missing permissions). > > There was an idea to migrate towards a Kernel > syscall based solution for port locking. > > What's the status here? > Hi Martin, I'm in favor of deprecating the current FHS locking mechanism in favor of an IOCTL when available. I think it will be available on all the platforms but do not know for sure. The status is unchanged. I've had very few free cycles for such things. Feel free to take a stab at it if you have some time. I believe the IOCTL is used in the Mac OS X code already. I don't see any real backwards compatability issues and the IOCTL should just work. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Apr 24 06:14:06 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 14:14:06 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Thanks Trent. Problem is only that I'm really not at all Familiar with the C part of RXTX. If there Were anything I could do in Java for this, It would be easier for me.... ... Are there any C experts here on the list Who'd like to look at ioctl port locking For linux? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Donnerstag, 24. April 2008 04:32 > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > I'm wondering what the status is with RXTX locking > > serial ports on Linux? > > > > My understanding is that the mechanism used in > > 2.1-7r2 (lockfiles) is not really state of the art, and > > has lots of problems (e.g. missing permissions). > > > > There was an idea to migrate towards a Kernel > > syscall based solution for port locking. > > > > What's the status here? > > > > Hi Martin, > > I'm in favor of deprecating the current FHS locking mechanism > in favor of > an IOCTL when available. I think it will be available on all the > platforms but do not know for sure. > > The status is unchanged. I've had very few free cycles for > such things. > Feel free to take a stab at it if you have some time. I > believe the IOCTL > is used in the Mac OS X code already. > > I don't see any real backwards compatability issues and the > IOCTL should > just work. > > -- > Trent Jarvi > tjarvi at qbang.org > From sspies at sloc.de Thu Apr 24 07:15:36 2008 From: sspies at sloc.de (Sebastian Spies) Date: Thu, 24 Apr 2008 15:15:36 +0200 (CEST) Subject: [Rxtx] rxtx on gumstix: Interrupted system call In-Reply-To: <47FB7B20.7080504@sloc.de> References: <47FB7B20.7080504@sloc.de> Message-ID: <55445.130.83.139.205.1209042936.squirrel@ssl.sloc.de> Dear list, while porting rxtx to the gumstix, I found out, that select used in readArray in SerialImp.c might not work as expected. Maybe, because of missing TIOCSERGETLSR-support? select is often interrupted, so i wrote the following quick'n'dirty hack to make it work on gumstix: diff -Nur rxtx-2.1-7r2/src/SerialImp.c rxtx-2.1-7r2/src/SerialImp.c --- rxtx-2.1-7r2/src/SerialImp.c 2006-01-29 23:19:04.000000000 +0100 +++ rxtx-2.1-7r2-patched/src/SerialImp.c 2008-04-24 14:30:17.000000000 +0200 @@ -3380,7 +3381,7 @@ JNIEXPORT jint JNICALL RXTXPort(readArray)( JNIEnv *env, jobject jobj, jbyteArray jbarray, jint offset, jint length ) { - int bytes; + int bytes = 0; jbyte *body; /* char msg[80]; */ int fd = get_java_var( env, jobj, "fd", "I" ); @@ -3397,9 +3398,18 @@ "readArray", "Invalid length" ); return -1; } - body = (*env)->GetByteArrayElements( env, jbarray, 0 ); - bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ - (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + while(1 > bytes) + { + body = (*env)->GetByteArrayElements( env, jbarray, 0 ); + bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ + (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + // quick'n'dirty - SSP + report (" trying again... \n"); + errno = 0; + } + if( bytes < 0 ) { report( "RXTXPort:readArray bytes < 0" ); LEAVE( "RXTXPort:readArray" ); > Hey, > > I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use > RXTXPort$SerialInputStream.read(), then I get the following Exception. I > did not yet figure out which system call is interrupted as strace > produces loads of output. > > Any help would be very appreciated. Thanks in advance. > Sebastian > > > [java] java.io.IOException: Interrupted system call in readArray > [java] at gnu.io.RXTXPort.readArray(Native Method) > [java] at > gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) > [java] at > java.io.FilterInputStream.read(FilterInputStream.java:189) > [java] at > java.io.BufferedInputStream.refill(BufferedInputStream.java:371) > [java] at > java.io.BufferedInputStream.read(BufferedInputStream.java:229) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) > [java] at > com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) > > -- > Sebastian Spies > > mail: sspies at sloc.de > > > > From fire_baptized at hotmail.com Thu Apr 24 18:27:48 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Thu, 24 Apr 2008 20:27:48 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hello I am having a problem with the serial device connecting (software wise) to the serial port. However I have a test program and it seems to work just fine in that environment - and it doesnt use GUI. The error I am getting is : PortNotFoundException Now the way I have it setup in the GUI environment is that once the user pushes a JButton the program connects using this class: protected void establishConnection() { try { portId = CommPortIdentifier.getPortIdentifier("COM3"); System.out.println("Establishing connction....."); messages[0] = "\nEstablishing connction.....\n"; } catch ( NoSuchPortException noport) { System.out.println("Port not found: "+ noport); messages[0] = "Port not found: "+ noport+"\n"; } try { serialPort = (SerialPort) portId.open("serial", 50); System.out.println("Port has been found."); messages[1] = "Port has been found.\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[1] = "" +usedport; } try { serialPort = (SerialPort) portId.open("serial", 50); messages[2] = "Connecting to COM3 on port 50....\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; } try { serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); System.out.println("Esablishing the transfer rate settings for COM3."); messages[3] = "Esablishing the transfer rate settings for COM3.\n"; } catch (UnsupportedCommOperationException nosupcom) { System.out.println(nosupcom); System.out.println("The tranfer rate could not be esblished on COM3."); messages[3] = "The tranfer rate could not be esblished on COM3.\n"; } System.out.println(serialPort.getFlowControlMode()); messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; //sendDataOut(buffer[3],buffer[4]); } I need all the data in this method (and all the string values in this method) to be printed out on a JTextArea. I wont do me any good if not all the text is printed on a JTextArea in another class. So I have the text printing the JTextArea correctly, but everytime the JButton is activated - it gives me that error message. I did add a disconnect button that is supposed to call the serialPort.close(). _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/273fd4ec/attachment-0016.html From tjarvi at qbang.org Thu Apr 24 21:54:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Apr 2008 21:54:10 -0600 (MDT) Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > Hello I am having a problem with the serial device connecting (software > wise) to the serial port. However I have a test program and it seems to > work just fine in that environment - and it doesnt use GUI. The error I > am getting is : PortNotFoundException Now the way I have it setup in the > GUI environment is that once the user pushes a JButton the program > connects using this class: > > protected void establishConnection() { > try { > portId = CommPortIdentifier.getPortIdentifier("COM3"); > System.out.println("Establishing connction....."); > messages[0] = "\nEstablishing connction.....\n"; > } > catch ( NoSuchPortException noport) { > System.out.println("Port not found: "+ noport); > messages[0] = "Port not found: "+ noport+"\n"; > } > try { > serialPort = (SerialPort) portId.open("serial", 50); > System.out.println("Port has been found."); > messages[1] = "Port has been found.\n"; > } > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[1] = "" +usedport; > } ================================================================= > try { > serialPort = (SerialPort) portId.open("serial", 50); > messages[2] = "Connecting to COM3 on port 50....\n"; > } ================================================================== > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > } > try { > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > System.out.println("Esablishing the transfer rate settings for COM3."); > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > } > catch (UnsupportedCommOperationException nosupcom) { > System.out.println(nosupcom); > System.out.println("The tranfer rate could not be esblished on COM3."); > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > } > System.out.println(serialPort.getFlowControlMode()); > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > //sendDataOut(buffer[3],buffer[4]); > } > > I need all the data in this method (and all the string values in this > method) to be printed out on a JTextArea. I wont do me any good if not > all the text is printed on a JTextArea in another class. So I have the > text printing the JTextArea correctly, but everytime the JButton is > activated - it gives me that error message. I did add a disconnect > button that is supposed to call the serialPort.close(). > The open code used twice is going to throw an exception. It may be that you catch the exception above this code and print a confusing message? A common mistake is people will accidently run two copies of their program. The first instance of the program will open the port and prevent enumeration (finding the port) in the second instance of the program. As an example, you may be running your text based application which is preventing the GUI from seeing the port. Enumeration is done by trying to open the port. If the port is open, Enumeration fails. -- Trent Jarvi tjarvi at qbang.org From fire_baptized at hotmail.com Thu Apr 24 22:32:05 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 00:32:05 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Wow - thanks dude what a dumb thing for me to not catch..... now here is the current problem - right now I am trying to output data again one is with the test program - and it seems that serialPort.setRTS(true); is throwing an exceptions there - now if I show this code please bare in mind that I am only testing - the code is kinda sloppy in my mind - but if I can figure out why calling this function is throwing an exception then maybe I can figure out why my GUI application is getting the same null pointer exceptions when try to send out the data stream. FYI Trent this email is not directed towards you - anyone can jump in on this public static void main(String args[]) { byte[] b = new byte[64]; int keyinput = 0 ; byte x = 0; byte y = 0; PortTesting1 testports = new PortTesting1(); try { joyskoro = Joystick.createInstance(); } catch (IOException ioexc) { System.out.println("There is an input/output problem: " + ioexc); } while (true) { joyskoro.poll(); b[0] = ((byte) -(10 * joyskoro.getY())); b[1] = ((byte) (10 * joyskoro.getX())); System.out.println("The 3rd byte is: " +b[0]); System.out.println("The 4rd byte is: " +b[1]); serialPort.setRTS(true); // HERE IS WHERE THE PROBLEM IS !!!!!!! ON THIS LINE but if I dont have it active in my program the Bluetooth device (that is System.out.println("Ready to send :-) !"); //connected to the serial port does not send out data!!!!! if (joyskoro.isButtonDown(joyskoro.BUTTON10)) { System.out.println("Connection terminated."); serialPort.close(); break; } if (joyskoro.isButtonDown(joyskoro.BUTTON2)) { boolean flag = true; //reading from key input from the keyboard System.out.println("Please input a command: "); while (flag) { try { keyinput = System.in.read(); } catch (IOException ioexc) {/*there is no need to put * anything here */ } if((char)keyinput=='w') { pushIt((byte)85); } if((char)keyinput=='s') { pushIt((byte)84); } if((char)keyinput=='a') { pushIt((byte)83); } if((char)keyinput=='d') { pushIt((byte)82); } if((char)keyinput=='q') { pushIt((byte)89); } if((char)keyinput=='\t') { //this stop reading input from the keyboard flag = false; } } and help anyways here is the block of code that throwing an exception for the test program: > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/5c8f7d68/attachment-0016.html From fire_baptized at hotmail.com Fri Apr 25 07:59:53 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 09:59:53 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Are there any examples of how to push out data? As in using input and output streams - if I can compare code maybe I can see where this is causing a problem. I have a byte array that I am pushing out data. I keep getting null pointer exceptions every where I turn. > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/22228ab6/attachment-0015.html From ajmas at sympatico.ca Sat Apr 26 07:37:09 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 26 Apr 2008 09:37:09 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hi, On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote: > > Are there any examples of how to push out data? As in using input > and output streams - if I can compare code maybe I can see where > this is causing a problem. I have a byte array that I am pushing > out data. I keep getting null pointer exceptions every where I turn. > There are some examples here that might be of help: http://rxtx.qbang.org/wiki/index.php/Examples Andre From fire_baptized at hotmail.com Sat Apr 26 20:13:54 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Sat, 26 Apr 2008 22:13:54 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: looked at those....yep didnt help - I need to push out data with GUI and not get a null pointer exception everytime I try. > CC: rxtx at qbang.org> From: ajmas at sympatico.ca> To: fire_baptized at hotmail.com> Subject: Re: [Rxtx] Serial Problems with Gui.....> Date: Sat, 26 Apr 2008 09:37:09 -0400> > Hi,> > > On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote:> >> > Are there any examples of how to push out data? As in using input > > and output streams - if I can compare code maybe I can see where > > this is causing a problem. I have a byte array that I am pushing > > out data. I keep getting null pointer exceptions every where I turn.> >> > There are some examples here that might be of help:> > http://rxtx.qbang.org/wiki/index.php/Examples> > Andre _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080426/09f95b41/attachment-0014.html From michael.erskine at ketech.com Mon Apr 28 02:47:22 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 28 Apr 2008 09:47:22 +0100 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D426EF3CBBC5@no-sv-03.ketech.local> Jesrael D. Summerhill wrote: > looked at those....yep didnt help - I need to push out data with GUI and > not get a null pointer exception everytime I try. So it seems pretty obvious that your code needs to check for nulls wherever one may occur and report what's happening. Alternatively, catch the npe and display the stack trace. Then you can fix your code so it doesn't try to work with something that ain't there. Regards, Michael Erskine. From scldad at sdc.com.au Mon Apr 28 03:58:34 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Mon, 28 Apr 2008 19:28:34 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Message-ID: <200804281928.34454.scldad@sdc.com.au> Has anybody done any design work on this? The first thing that springs to mind is that we still need to check for lock files because other apps tend to use that approach even if we go to ioctl. Cheers, Stephen Davies On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > Thanks Trent. > > Problem is only that I'm really not at all > Familiar with the C part of RXTX. If there > Were anything I could do in Java for this, > It would be easier for me.... > > ... Are there any C experts here on the list > Who'd like to look at ioctl port locking > For linux? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > -----Original Message----- > > From: Trent Jarvi [mailto:tjarvi at qbang.org] > > Sent: Donnerstag, 24. April 2008 04:32 > > To: Oberhuber, Martin > > Cc: rxtx at qbang.org > > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > > > I'm wondering what the status is with RXTX locking > > > serial ports on Linux? > > > > > > My understanding is that the mechanism used in > > > 2.1-7r2 (lockfiles) is not really state of the art, and > > > has lots of problems (e.g. missing permissions). > > > > > > There was an idea to migrate towards a Kernel > > > syscall based solution for port locking. > > > > > > What's the status here? > > > > Hi Martin, > > > > I'm in favor of deprecating the current FHS locking mechanism > > in favor of > > an IOCTL when available. I think it will be available on all the > > platforms but do not know for sure. > > > > The status is unchanged. I've had very few free cycles for > > such things. > > Feel free to take a stab at it if you have some time. I > > believe the IOCTL > > is used in the Mac OS X code already. > > > > I don't see any real backwards compatability issues and the > > IOCTL should > > just work. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Mon Apr 28 04:21:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 28 Apr 2008 04:21:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804281928.34454.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: I don't think there would need to be any architectural changes. A couple ifdefs and minor changes in the current code should be enough. Proposal: FHS/UUCP locks: continue to respect them, try to create them but do not error if the IOCTL is supported. (But does the IOCTL being defined mean it will work?) Enumeration: Do not assert the IOCTL while opening. Serial.open: assert the IOCTL after open. Continue to use locks as described above after asserting the IOCTL. If the IOCTL is defined but not working, handle it here. Failure cases include the IOCTL is not supported and the port is already locked. On Mon, 28 Apr 2008, Stephen Davies wrote: > Has anybody done any design work on this? > The first thing that springs to mind is that we still need to check for lock > files because other apps tend to use that approach even if we go to ioctl. > > Cheers, > Stephen Davies > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: >> Thanks Trent. >> >> Problem is only that I'm really not at all >> Familiar with the C part of RXTX. If there >> Were anything I could do in Java for this, >> It would be easier for me.... >> >> ... Are there any C experts here on the list >> Who'd like to look at ioctl port locking >> For linux? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >>> -----Original Message----- >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] >>> Sent: Donnerstag, 24. April 2008 04:32 >>> To: Oberhuber, Martin >>> Cc: rxtx at qbang.org >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? >>> >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: >>>> Dear RXTX community, >>>> >>>> I'm wondering what the status is with RXTX locking >>>> serial ports on Linux? >>>> >>>> My understanding is that the mechanism used in >>>> 2.1-7r2 (lockfiles) is not really state of the art, and >>>> has lots of problems (e.g. missing permissions). >>>> >>>> There was an idea to migrate towards a Kernel >>>> syscall based solution for port locking. >>>> >>>> What's the status here? >>> >>> Hi Martin, >>> >>> I'm in favor of deprecating the current FHS locking mechanism >>> in favor of >>> an IOCTL when available. I think it will be available on all the >>> platforms but do not know for sure. >>> >>> The status is unchanged. I've had very few free cycles for >>> such things. >>> Feel free to take a stab at it if you have some time. I >>> believe the IOCTL >>> is used in the Mac OS X code already. >>> >>> I don't see any real backwards compatability issues and the >>> IOCTL should >>> just work. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Tue Apr 29 12:04:04 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Apr 2008 20:04:04 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Hi all, The biggest problem that I have seen with lockfiles on Linux At least is, that it seems there is no standard with respect To the folder in which they should be created. Also, many Distributions seem to set up file system permissions in such A way that writing to the lockfile folder is not allowed for The normal user -- that's why we stopped using lockfiles In our commercial product. If we are to still respect lockfiles, we first need to Understand where we are expected to look for them. Does Anybody have any insight what variants of lockfile folder Schema exist out there in the wild? Some apps like minicom Seem to even allow users to manually specify a lockfile Folder of their choice. Because of the difficulty finding the right lockfile folder, And because of the inherent risk of thinking that something Might be locked while it actually isn't, I'd suggest that RXTX should have a "soft-off" feature that allows disabling ALL Lockfile checks at runtime without recompiling the native Sharedlibs. Trent - I like your strategy outline, but I think that it Needs to be configurable by the client such that users and/or Customer Support can disable lockfiles / disable ioctl in Case they detect that they are runing on an OS / Kernal that Does not support one or the other. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Montag, 28. April 2008 12:22 > To: Stephen Davies > Cc: rxtx at qbang.org; Oberhuber, Martin; Trent Jarvi > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > I don't think there would need to be any architectural > changes. A couple > ifdefs and minor changes in the current code should be enough. > > Proposal: > > FHS/UUCP locks: > continue to respect them, try to create them but do not error if > the IOCTL is supported. (But does the IOCTL being defined mean > it will work?) > Enumeration: > Do not assert the IOCTL while opening. > Serial.open: > assert the IOCTL after open. Continue to use locks as described > above after asserting the IOCTL. If the IOCTL is defined but > not working, handle it here. Failure cases include the IOCTL > is not supported and the port is already locked. > > On Mon, 28 Apr 2008, Stephen Davies wrote: > > > Has anybody done any design work on this? > > The first thing that springs to mind is that we still need > to check for lock > > files because other apps tend to use that approach even if > we go to ioctl. > > > > Cheers, > > Stephen Davies > > > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > >> Thanks Trent. > >> > >> Problem is only that I'm really not at all > >> Familiar with the C part of RXTX. If there > >> Were anything I could do in Java for this, > >> It would be easier for me.... > >> > >> ... Are there any C experts here on the list > >> Who'd like to look at ioctl port locking > >> For linux? > >> > >> Thanks, > >> -- > >> Martin Oberhuber, Senior Member of Technical Staff, Wind River > >> Target Management Project Lead, DSDP PMC Member > >> http://www.eclipse.org/dsdp/tm > >> > >>> -----Original Message----- > >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] > >>> Sent: Donnerstag, 24. April 2008 04:32 > >>> To: Oberhuber, Martin > >>> Cc: rxtx at qbang.org > >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? > >>> > >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > >>>> Dear RXTX community, > >>>> > >>>> I'm wondering what the status is with RXTX locking > >>>> serial ports on Linux? > >>>> > >>>> My understanding is that the mechanism used in > >>>> 2.1-7r2 (lockfiles) is not really state of the art, and > >>>> has lots of problems (e.g. missing permissions). > >>>> > >>>> There was an idea to migrate towards a Kernel > >>>> syscall based solution for port locking. > >>>> > >>>> What's the status here? > >>> > >>> Hi Martin, > >>> > >>> I'm in favor of deprecating the current FHS locking mechanism > >>> in favor of > >>> an IOCTL when available. I think it will be available on all the > >>> platforms but do not know for sure. > >>> > >>> The status is unchanged. I've had very few free cycles for > >>> such things. > >>> Feel free to take a stab at it if you have some time. I > >>> believe the IOCTL > >>> is used in the Mac OS X code already. > >>> > >>> I don't see any real backwards compatability issues and the > >>> IOCTL should > >>> just work. > >>> > >>> -- > >>> Trent Jarvi > >>> tjarvi at qbang.org > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > From Steffen.DETTMER at ingenico.com Tue Apr 29 13:34:44 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 29 Apr 2008 21:34:44 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Message-ID: <20080429193444.GU2928@elberon.bln.de.ingenico.com> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > The biggest problem that I have seen with lockfiles on Linux > At least is, that it seems there is no standard with respect > To the folder in which they should be created. Also, many > Distributions seem to set up file system permissions in such > A way that writing to the lockfile folder is not allowed for > The normal user -- that's why we stopped using lockfiles > In our commercial product. It seems it depends on the expectations. I consider it as a feature that by default a linux user cannot access serial ports. Maybe root connected a modem (can produce phone bills) or even some serial card reader, maybe with the web servers key pair. I would expect that by default a user cannot open the serial port because of insufficient permissions on the device file. I would expect this on other unices as well (but I don't know it). For windows I think it should be similar but not impacting so much in practice, because often windows users work with big permissions on a somewhat high priviledge level or even Administrator. > If we are to still respect lockfiles, we first need to > Understand where we are expected to look for them. Does > Anybody have any insight what variants of lockfile folder > Schema exist out there in the wild? Some apps like minicom > Seem to even allow users to manually specify a lockfile > Folder of their choice. At least my (ancient) minicom does not allow the user to change this option, it is displayed but read-only, but root is allowed to change it. > Because of the difficulty finding the right lockfile folder, > And because of the inherent risk of thinking that something > Might be locked while it actually isn't, I'd suggest that > RXTX should have a "soft-off" feature that allows disabling > ALL Lockfile checks at runtime without recompiling the native > Sharedlibs. sounds very reasonable, yes... and as admin I would not wish that users could skip such locking because they do things wrong by default ;) (in the end I guess that is related to the dilemma, that hotplug/user-owned-periphery and multi-user systems simply conflict) > Trent - I like your strategy outline, but I think that it > Needs to be configurable by the client such that users and/or > Customer Support can disable lockfiles / disable ioctl in > Case they detect that they are runing on an OS / Kernal that > Does not support one or the other. Yes, this would be good I guess... Applications could offer configuration options to control that, maybe similarily as minicom. BTW, man minicom tells: *B - Lock file location On most systems This should be /usr/spool/uucp. Linux systems use /var/lock. If this directory does not exist, minicom will not attempt to use lockfiles. The statement `Linux systems use /var/lock' is interesting, does anyone know the source of this convention? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Tue Apr 29 16:11:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Apr 2008 16:11:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? These details are outlined in the Filesystem Hierarchy Standard (FHS). http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLOCKLOCKFILES -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Tue Apr 29 18:58:09 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Wed, 30 Apr 2008 10:28:09 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: <200804301028.09307.scldad@sdc.com.au> I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is the same. Any ideas as to how to handle this? Stephen On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: > * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > > The biggest problem that I have seen with lockfiles on Linux > > At least is, that it seems there is no standard with respect > > To the folder in which they should be created. Also, many > > Distributions seem to set up file system permissions in such > > A way that writing to the lockfile folder is not allowed for > > The normal user -- that's why we stopped using lockfiles > > In our commercial product. > > It seems it depends on the expectations. I consider it as a > feature that by default a linux user cannot access serial ports. > Maybe root connected a modem (can produce phone bills) or even > some serial card reader, maybe with the web servers key pair. > > I would expect that by default a user cannot open the serial port > because of insufficient permissions on the device file. I would > expect this on other unices as well (but I don't know it). > > For windows I think it should be similar but not impacting so > much in practice, because often windows users work with big > permissions on a somewhat high priviledge level or even > Administrator. > > > If we are to still respect lockfiles, we first need to > > Understand where we are expected to look for them. Does > > Anybody have any insight what variants of lockfile folder > > Schema exist out there in the wild? Some apps like minicom > > Seem to even allow users to manually specify a lockfile > > Folder of their choice. > > At least my (ancient) minicom does not allow the user to change > this option, it is displayed but read-only, but root is allowed > to change it. > > > Because of the difficulty finding the right lockfile folder, > > And because of the inherent risk of thinking that something > > Might be locked while it actually isn't, I'd suggest that > > RXTX should have a "soft-off" feature that allows disabling > > ALL Lockfile checks at runtime without recompiling the native > > Sharedlibs. > > sounds very reasonable, yes... > and as admin I would not wish that users could skip such > locking because they do things wrong by default ;) > > (in the end I guess that is related to the dilemma, that > hotplug/user-owned-periphery and multi-user systems simply > conflict) > > > Trent - I like your strategy outline, but I think that it > > Needs to be configurable by the client such that users and/or > > Customer Support can disable lockfiles / disable ioctl in > > Case they detect that they are runing on an OS / Kernal that > > Does not support one or the other. > > Yes, this would be good I guess... Applications could offer > configuration options to control that, maybe similarily as > minicom. > > BTW, man minicom tells: > > *B - Lock file location > On most systems This should be /usr/spool/uucp. > Linux systems use /var/lock. If this directory > does not exist, minicom will not attempt to use > lockfiles. > > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure > and expedient electronic transaction acceptance. Ingenico products leverage > proven technology, established standards and unparalleled ergonomics to > provide optimal reliability, versatility and usability. This comprehensive > range of products is complemented by a global array of services and > partnerships, enabling businesses in a number of vertical sectors to accept > transactions anywhere their business takes them. www.ingenico.com This > message may contain confidential and/or privileged information. If you are > not the addressee or authorized to receive this for the addressee, you must > not use, copy, disclose or take any action based on this message or any > information herein. If you have received this message in error, please > advise the sender immediately by reply e-mail and delete this message. > Thank you for your cooperation. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Wed Apr 30 19:30:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 30 Apr 2008 19:30:51 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804301028.09307.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> <200804301028.09307.scldad@sdc.com.au> Message-ID: Hi Stephen, I suspect ioctl/TIOCEXCL open/O_EXCL would do the job. Mac uses TIOCEXCL and it is POSIX. We use O_EXCL for lockfiles on Linux already. On Wed, 30 Apr 2008, Stephen Davies wrote: > I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is > the same. > > Any ideas as to how to handle this? > > Stephen > > > On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: >> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: >>> The biggest problem that I have seen with lockfiles on Linux >>> At least is, that it seems there is no standard with respect >>> To the folder in which they should be created. Also, many >>> Distributions seem to set up file system permissions in such >>> A way that writing to the lockfile folder is not allowed for >>> The normal user -- that's why we stopped using lockfiles >>> In our commercial product. >> >> It seems it depends on the expectations. I consider it as a >> feature that by default a linux user cannot access serial ports. >> Maybe root connected a modem (can produce phone bills) or even >> some serial card reader, maybe with the web servers key pair. >> >> I would expect that by default a user cannot open the serial port >> because of insufficient permissions on the device file. I would >> expect this on other unices as well (but I don't know it). >> >> For windows I think it should be similar but not impacting so >> much in practice, because often windows users work with big >> permissions on a somewhat high priviledge level or even >> Administrator. >> >>> If we are to still respect lockfiles, we first need to >>> Understand where we are expected to look for them. Does >>> Anybody have any insight what variants of lockfile folder >>> Schema exist out there in the wild? Some apps like minicom >>> Seem to even allow users to manually specify a lockfile >>> Folder of their choice. >> >> At least my (ancient) minicom does not allow the user to change >> this option, it is displayed but read-only, but root is allowed >> to change it. >> >>> Because of the difficulty finding the right lockfile folder, >>> And because of the inherent risk of thinking that something >>> Might be locked while it actually isn't, I'd suggest that >>> RXTX should have a "soft-off" feature that allows disabling >>> ALL Lockfile checks at runtime without recompiling the native >>> Sharedlibs. >> >> sounds very reasonable, yes... >> and as admin I would not wish that users could skip such >> locking because they do things wrong by default ;) >> >> (in the end I guess that is related to the dilemma, that >> hotplug/user-owned-periphery and multi-user systems simply >> conflict) >> >>> Trent - I like your strategy outline, but I think that it >>> Needs to be configurable by the client such that users and/or >>> Customer Support can disable lockfiles / disable ioctl in >>> Case they detect that they are runing on an OS / Kernal that >>> Does not support one or the other. >> >> Yes, this would be good I guess... Applications could offer >> configuration options to control that, maybe similarily as >> minicom. >> >> BTW, man minicom tells: >> >> *B - Lock file location >> On most systems This should be /usr/spool/uucp. >> Linux systems use /var/lock. If this directory >> does not exist, minicom will not attempt to use >> lockfiles. >> >> The statement `Linux systems use /var/lock' is interesting, does >> anyone know the source of this convention? >> >> oki, >> >> Steffen >> >> About Ingenico Throughout the world businesses rely on Ingenico for secure >> and expedient electronic transaction acceptance. Ingenico products leverage >> proven technology, established standards and unparalleled ergonomics to >> provide optimal reliability, versatility and usability. This comprehensive >> range of products is complemented by a global array of services and >> partnerships, enabling businesses in a number of vertical sectors to accept >> transactions anywhere their business takes them. www.ingenico.com This >> message may contain confidential and/or privileged information. If you are >> not the addressee or authorized to receive this for the addressee, you must >> not use, copy, disclose or take any action based on this message or any >> information herein. If you have received this message in error, please >> advise the sender immediately by reply e-mail and delete this message. >> Thank you for your cooperation. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0040.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0038.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0025.html From pboulton at pulsetracer.com Fri Apr 18 14:30:13 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Fri, 18 Apr 2008 13:30:13 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site Message-ID: <480904D5.1060307@pulsetracer.com> Hello, gentle serial porters. I have downloaded the zipped up binaries for use on Windows without Sun's CommAPI, but don't seem able to extract anything from the download. Go to main page, http://www.rxtx.org/ Click on Downloads I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) And I save it to disk. If I try and extract the files with WinZip, Winzip thinks the archive is corrupt. If I try using Windows Explorer, I am able to extract it into a single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than the original .zip. Any help would be much appreciated. Sincerely, Philip Boulton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080418/97d89793/attachment-0023.html From tjarvi at qbang.org Fri Apr 18 19:07:00 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 18 Apr 2008 19:07:00 -0600 (MDT) Subject: [Rxtx] Difficulty opening zip file at rxtx site In-Reply-To: <480904D5.1060307@pulsetracer.com> References: <480904D5.1060307@pulsetracer.com> Message-ID: On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org From pboulton at pulsetracer.com Sat Apr 19 12:46:26 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Sat, 19 Apr 2008 11:46:26 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site References: <480904D5.1060307@pulsetracer.com> Message-ID: <53DB7576450695419E09299104043761A78533@ZTGSERVER.ztg.local> I have been able to get my hands on the binaries, by going to the ftp directory /pub/rxtx at ftp.qbang.org,, and ftping the file rxtx-2.1-7-bins-r2.zip . This opens happily with Winzip, and extracts as the set of files that you describe below. I only experience the ill-formed archive problem by clicking the link on the rxtx.org Downloads page (http://rxtx.qbang.org/pub/rxtx/ rxtx-2.1-7-bins-r2.zip ). Not sure what to make of that. Philip Boulton ________________________________ From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Fri 4/18/2008 6:07 PM To: Philip Boulton Cc: rxtx at qbang.org Subject: Re: [Rxtx] Difficulty opening zip file at rxtx site On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080419/147923bb/attachment-0022.html From jlar310 at gmail.com Sat Apr 19 19:11:55 2008 From: jlar310 at gmail.com (Jeff Larsen) Date: Sat, 19 Apr 2008 20:11:55 -0500 Subject: [Rxtx] Moxa serial over Ethernet driver Message-ID: Hi all, I've been using javax.comm for years to communicate with a legacy radio data system. We want to migrate the java side of the system to a VMware Server virtual machine. We've had great success using Moxa DE-303 and 5610 serial over Ethernet appliances and virtual machines for running hylafax. The OS (Linux in this case) uses a kernel driver to communicate with the Moxa via a virtual serial port such as /dev/ttyr00. I want to do the same thing with javax.comm or gnu.io to connect to a virtual serial port. However I'm hitting road blocks everywhere. javax.comm for Linux sees the virtual port, but there are transmission errors. Tried Solaris too, but the Solaris Moxa drivers don't play nice with javax.comm because the driver uses /dev/pts/n instead of /dev/term/x. Next I tried RXTX on Linux, but I'm getting NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX on Solaris. Has anyone used RXTX with serial over Ethernet devices? Any hints on how to make it work? I know that I'm not completely off track because javax.comm does work with Moxa on a Windows platform, but that's just not an option for production deployment. -- Jeff From tjarvi at qbang.org Sat Apr 19 21:08:41 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 19 Apr 2008 21:08:41 -0600 (MDT) Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: yOn Sat, 19 Apr 2008, Jeff Larsen wrote: > Hi all, > > I've been using javax.comm for years to communicate with a legacy > radio data system. We want to migrate the java side of the system to a > VMware Server virtual machine. We've had great success using Moxa > DE-303 and 5610 serial over Ethernet appliances and virtual machines > for running hylafax. The OS (Linux in this case) uses a kernel driver > to communicate with the Moxa via a virtual serial port such as > /dev/ttyr00. > > I want to do the same thing with javax.comm or gnu.io to connect to a > virtual serial port. However I'm hitting road blocks everywhere. > javax.comm for Linux sees the virtual port, but there are transmission > errors. Tried Solaris too, but the Solaris Moxa drivers don't play > nice with javax.comm because the driver uses /dev/pts/n instead of > /dev/term/x. Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris. > > Has anyone used RXTX with serial over Ethernet devices? Any hints on > how to make it work? > > I know that I'm not completely off track because javax.comm does work > with Moxa on a Windows platform, but that's just not an option for > production deployment. > > Moxa should work under linux. There may be minor issues depending upon how complete the kernel driver is but I think it will work. One of the minor issues is /dev/ttyr00 is not enumerated. There are several work arounds documented with the source code and on the wiki. The easiest solution for testing purposes is to make a symbolic link from /dev/ttyr00 to a port that is enumerated such as /dev/ttyS129. You can later alter the rxtx source or use properties to change the enumerated ports. -- Trent Jarvi tjarvi at qbang.org From d.tonhofer at m-plify.com Sun Apr 20 03:33:30 2008 From: d.tonhofer at m-plify.com (David Tonhofer (M-PLIFY S.A.)) Date: Sun, 20 Apr 2008 11:33:30 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: <480B0DEA.5010908@m-plify.com> Jeff Larsen wrote: > Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris It might be that the Java side of RXTX does not recognize that portname. Trying modifying src/RXTXCommDriver.java as described in this case: http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card From ajmas at sympatico.ca Sun Apr 20 16:37:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Apr 2008 18:37:59 -0400 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <480B0DEA.5010908@m-plify.com> References: <480B0DEA.5010908@m-plify.com> Message-ID: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > Jeff Larsen wrote: >> Next I tried RXTX on Linux, but I'm getting >> NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX >> on Solaris > It might be that the Java side of RXTX does not recognize that > portname. > Trying modifying src/RXTXCommDriver.java as described in this case: > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card I wonder whether it would be worth allowing custom port prefixes as a system parameter? For example: gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" Andre From Martin.Oberhuber at windriver.com Tue Apr 22 12:34:36 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 22 Apr 2008 20:34:36 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> References: <480B0DEA.5010908@m-plify.com> <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE6485848056CD6CE@ism-mail03.corp.ad.wrs.com> Sounds like a great idea... I'm wondering how the "variable part" after the Prefixes could be specified though? What about allowing Regular Expression character Classes in the existing System Property for specifying ports: System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyS[0-9],ttyS[ABC],ttyUSB[0-9a-z]"); The set of allowed patterns would of course need to Be restricted compared to REGEX, because it must be A syntax that supports iterating over it. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Montag, 21. April 2008 00:38 > To: rxtx at qbang.org and Users > Subject: Re: [Rxtx] Moxa serial over Ethernet driver > > > On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > > Jeff Larsen wrote: > >> Next I tried RXTX on Linux, but I'm getting > >> NoSuchPortException connecting to /dev/ttyr00. I have yet > to try RXTX > >> on Solaris > > It might be that the Java side of RXTX does not recognize that > > portname. > > Trying modifying src/RXTXCommDriver.java as described in this case: > > > > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_ > SST-4P.2FLP_multiport_card > > I wonder whether it would be worth allowing custom port > prefixes as a > system parameter? For > example: > > gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Loi.TRAN at weatherford.com Tue Apr 22 13:10:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Tue, 22 Apr 2008 14:10:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled Message-ID: Hi, I'm currently using the Java RXTX API to interface to a serial port. The serial port is connected to a bridge board that communicates with our communications system running at 1.875 Mbps which is linked to an embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no flow control). I send a command to the embedded board through the serial-bridge board which then is relayed to the embedded board. The command sent asks the embedded board to dump a binary image. Here's where I'm hitting some problems. I've successfully done this is an integrated serial port from the laptop. The binary file that comes back is consistent on every attempt. When I use the application I've written to do the same thing with a USB-to-serial adapter, the image I get back is not the same as the image I receive through the USB-to-serial adapter is not consistent at all. A final thing is that when I use a terminal program to dump the binary image with the USB-serial adapter, the image is correct. Every time! What is the terminal program doing that's not being done in my application? My application is quite simple. Has anyone observed this behavior before? If you have, I'd like to know how you've gotten around this problem. Thanks, LT =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From tjarvi at qbang.org Tue Apr 22 21:11:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 22 Apr 2008 21:11:10 -0600 (MDT) Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org From Loi.TRAN at weatherford.com Wed Apr 23 08:35:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Wed, 23 Apr 2008 09:35:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: Thanks for all the responses. I finally tried something that worked consistently. I updated my Prolific driver and repeated my tests. It worked. If you're using the Prolific type USB-serial adapters, do no use the Prolific version 2.0.2.1 driver on Windows. Update it to the latest 2.0.2.8 version. Again, thanks for all the responses. LT -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Tuesday, April 22, 2008 10:11 PM To: TRAN, Loi X. Cc: rxtx at qbang.org Subject: Re: [Rxtx] Prolific USB - RXTX data mangled On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From Martin.Oberhuber at windriver.com Wed Apr 23 18:54:26 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 02:54:26 +0200 Subject: [Rxtx] RXTX port locking on Linux status? Message-ID: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Dear RXTX community, I'm wondering what the status is with RXTX locking serial ports on Linux? My understanding is that the mechanism used in 2.1-7r2 (lockfiles) is not really state of the art, and has lots of problems (e.g. missing permissions). There was an idea to migrate towards a Kernel syscall based solution for port locking. What's the status here? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/9878db9f/attachment-0018.html From tjarvi at qbang.org Wed Apr 23 20:32:24 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Apr 2008 20:32:24 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > Dear RXTX community, > > I'm wondering what the status is with RXTX locking > serial ports on Linux? > > My understanding is that the mechanism used in > 2.1-7r2 (lockfiles) is not really state of the art, and > has lots of problems (e.g. missing permissions). > > There was an idea to migrate towards a Kernel > syscall based solution for port locking. > > What's the status here? > Hi Martin, I'm in favor of deprecating the current FHS locking mechanism in favor of an IOCTL when available. I think it will be available on all the platforms but do not know for sure. The status is unchanged. I've had very few free cycles for such things. Feel free to take a stab at it if you have some time. I believe the IOCTL is used in the Mac OS X code already. I don't see any real backwards compatability issues and the IOCTL should just work. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Apr 24 06:14:06 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 14:14:06 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Thanks Trent. Problem is only that I'm really not at all Familiar with the C part of RXTX. If there Were anything I could do in Java for this, It would be easier for me.... ... Are there any C experts here on the list Who'd like to look at ioctl port locking For linux? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Donnerstag, 24. April 2008 04:32 > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > I'm wondering what the status is with RXTX locking > > serial ports on Linux? > > > > My understanding is that the mechanism used in > > 2.1-7r2 (lockfiles) is not really state of the art, and > > has lots of problems (e.g. missing permissions). > > > > There was an idea to migrate towards a Kernel > > syscall based solution for port locking. > > > > What's the status here? > > > > Hi Martin, > > I'm in favor of deprecating the current FHS locking mechanism > in favor of > an IOCTL when available. I think it will be available on all the > platforms but do not know for sure. > > The status is unchanged. I've had very few free cycles for > such things. > Feel free to take a stab at it if you have some time. I > believe the IOCTL > is used in the Mac OS X code already. > > I don't see any real backwards compatability issues and the > IOCTL should > just work. > > -- > Trent Jarvi > tjarvi at qbang.org > From sspies at sloc.de Thu Apr 24 07:15:36 2008 From: sspies at sloc.de (Sebastian Spies) Date: Thu, 24 Apr 2008 15:15:36 +0200 (CEST) Subject: [Rxtx] rxtx on gumstix: Interrupted system call In-Reply-To: <47FB7B20.7080504@sloc.de> References: <47FB7B20.7080504@sloc.de> Message-ID: <55445.130.83.139.205.1209042936.squirrel@ssl.sloc.de> Dear list, while porting rxtx to the gumstix, I found out, that select used in readArray in SerialImp.c might not work as expected. Maybe, because of missing TIOCSERGETLSR-support? select is often interrupted, so i wrote the following quick'n'dirty hack to make it work on gumstix: diff -Nur rxtx-2.1-7r2/src/SerialImp.c rxtx-2.1-7r2/src/SerialImp.c --- rxtx-2.1-7r2/src/SerialImp.c 2006-01-29 23:19:04.000000000 +0100 +++ rxtx-2.1-7r2-patched/src/SerialImp.c 2008-04-24 14:30:17.000000000 +0200 @@ -3380,7 +3381,7 @@ JNIEXPORT jint JNICALL RXTXPort(readArray)( JNIEnv *env, jobject jobj, jbyteArray jbarray, jint offset, jint length ) { - int bytes; + int bytes = 0; jbyte *body; /* char msg[80]; */ int fd = get_java_var( env, jobj, "fd", "I" ); @@ -3397,9 +3398,18 @@ "readArray", "Invalid length" ); return -1; } - body = (*env)->GetByteArrayElements( env, jbarray, 0 ); - bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ - (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + while(1 > bytes) + { + body = (*env)->GetByteArrayElements( env, jbarray, 0 ); + bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ + (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + // quick'n'dirty - SSP + report (" trying again... \n"); + errno = 0; + } + if( bytes < 0 ) { report( "RXTXPort:readArray bytes < 0" ); LEAVE( "RXTXPort:readArray" ); > Hey, > > I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use > RXTXPort$SerialInputStream.read(), then I get the following Exception. I > did not yet figure out which system call is interrupted as strace > produces loads of output. > > Any help would be very appreciated. Thanks in advance. > Sebastian > > > [java] java.io.IOException: Interrupted system call in readArray > [java] at gnu.io.RXTXPort.readArray(Native Method) > [java] at > gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) > [java] at > java.io.FilterInputStream.read(FilterInputStream.java:189) > [java] at > java.io.BufferedInputStream.refill(BufferedInputStream.java:371) > [java] at > java.io.BufferedInputStream.read(BufferedInputStream.java:229) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) > [java] at > com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) > > -- > Sebastian Spies > > mail: sspies at sloc.de > > > > From fire_baptized at hotmail.com Thu Apr 24 18:27:48 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Thu, 24 Apr 2008 20:27:48 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hello I am having a problem with the serial device connecting (software wise) to the serial port. However I have a test program and it seems to work just fine in that environment - and it doesnt use GUI. The error I am getting is : PortNotFoundException Now the way I have it setup in the GUI environment is that once the user pushes a JButton the program connects using this class: protected void establishConnection() { try { portId = CommPortIdentifier.getPortIdentifier("COM3"); System.out.println("Establishing connction....."); messages[0] = "\nEstablishing connction.....\n"; } catch ( NoSuchPortException noport) { System.out.println("Port not found: "+ noport); messages[0] = "Port not found: "+ noport+"\n"; } try { serialPort = (SerialPort) portId.open("serial", 50); System.out.println("Port has been found."); messages[1] = "Port has been found.\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[1] = "" +usedport; } try { serialPort = (SerialPort) portId.open("serial", 50); messages[2] = "Connecting to COM3 on port 50....\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; } try { serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); System.out.println("Esablishing the transfer rate settings for COM3."); messages[3] = "Esablishing the transfer rate settings for COM3.\n"; } catch (UnsupportedCommOperationException nosupcom) { System.out.println(nosupcom); System.out.println("The tranfer rate could not be esblished on COM3."); messages[3] = "The tranfer rate could not be esblished on COM3.\n"; } System.out.println(serialPort.getFlowControlMode()); messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; //sendDataOut(buffer[3],buffer[4]); } I need all the data in this method (and all the string values in this method) to be printed out on a JTextArea. I wont do me any good if not all the text is printed on a JTextArea in another class. So I have the text printing the JTextArea correctly, but everytime the JButton is activated - it gives me that error message. I did add a disconnect button that is supposed to call the serialPort.close(). _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/273fd4ec/attachment-0017.html From tjarvi at qbang.org Thu Apr 24 21:54:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Apr 2008 21:54:10 -0600 (MDT) Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > Hello I am having a problem with the serial device connecting (software > wise) to the serial port. However I have a test program and it seems to > work just fine in that environment - and it doesnt use GUI. The error I > am getting is : PortNotFoundException Now the way I have it setup in the > GUI environment is that once the user pushes a JButton the program > connects using this class: > > protected void establishConnection() { > try { > portId = CommPortIdentifier.getPortIdentifier("COM3"); > System.out.println("Establishing connction....."); > messages[0] = "\nEstablishing connction.....\n"; > } > catch ( NoSuchPortException noport) { > System.out.println("Port not found: "+ noport); > messages[0] = "Port not found: "+ noport+"\n"; > } > try { > serialPort = (SerialPort) portId.open("serial", 50); > System.out.println("Port has been found."); > messages[1] = "Port has been found.\n"; > } > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[1] = "" +usedport; > } ================================================================= > try { > serialPort = (SerialPort) portId.open("serial", 50); > messages[2] = "Connecting to COM3 on port 50....\n"; > } ================================================================== > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > } > try { > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > System.out.println("Esablishing the transfer rate settings for COM3."); > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > } > catch (UnsupportedCommOperationException nosupcom) { > System.out.println(nosupcom); > System.out.println("The tranfer rate could not be esblished on COM3."); > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > } > System.out.println(serialPort.getFlowControlMode()); > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > //sendDataOut(buffer[3],buffer[4]); > } > > I need all the data in this method (and all the string values in this > method) to be printed out on a JTextArea. I wont do me any good if not > all the text is printed on a JTextArea in another class. So I have the > text printing the JTextArea correctly, but everytime the JButton is > activated - it gives me that error message. I did add a disconnect > button that is supposed to call the serialPort.close(). > The open code used twice is going to throw an exception. It may be that you catch the exception above this code and print a confusing message? A common mistake is people will accidently run two copies of their program. The first instance of the program will open the port and prevent enumeration (finding the port) in the second instance of the program. As an example, you may be running your text based application which is preventing the GUI from seeing the port. Enumeration is done by trying to open the port. If the port is open, Enumeration fails. -- Trent Jarvi tjarvi at qbang.org From fire_baptized at hotmail.com Thu Apr 24 22:32:05 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 00:32:05 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Wow - thanks dude what a dumb thing for me to not catch..... now here is the current problem - right now I am trying to output data again one is with the test program - and it seems that serialPort.setRTS(true); is throwing an exceptions there - now if I show this code please bare in mind that I am only testing - the code is kinda sloppy in my mind - but if I can figure out why calling this function is throwing an exception then maybe I can figure out why my GUI application is getting the same null pointer exceptions when try to send out the data stream. FYI Trent this email is not directed towards you - anyone can jump in on this public static void main(String args[]) { byte[] b = new byte[64]; int keyinput = 0 ; byte x = 0; byte y = 0; PortTesting1 testports = new PortTesting1(); try { joyskoro = Joystick.createInstance(); } catch (IOException ioexc) { System.out.println("There is an input/output problem: " + ioexc); } while (true) { joyskoro.poll(); b[0] = ((byte) -(10 * joyskoro.getY())); b[1] = ((byte) (10 * joyskoro.getX())); System.out.println("The 3rd byte is: " +b[0]); System.out.println("The 4rd byte is: " +b[1]); serialPort.setRTS(true); // HERE IS WHERE THE PROBLEM IS !!!!!!! ON THIS LINE but if I dont have it active in my program the Bluetooth device (that is System.out.println("Ready to send :-) !"); //connected to the serial port does not send out data!!!!! if (joyskoro.isButtonDown(joyskoro.BUTTON10)) { System.out.println("Connection terminated."); serialPort.close(); break; } if (joyskoro.isButtonDown(joyskoro.BUTTON2)) { boolean flag = true; //reading from key input from the keyboard System.out.println("Please input a command: "); while (flag) { try { keyinput = System.in.read(); } catch (IOException ioexc) {/*there is no need to put * anything here */ } if((char)keyinput=='w') { pushIt((byte)85); } if((char)keyinput=='s') { pushIt((byte)84); } if((char)keyinput=='a') { pushIt((byte)83); } if((char)keyinput=='d') { pushIt((byte)82); } if((char)keyinput=='q') { pushIt((byte)89); } if((char)keyinput=='\t') { //this stop reading input from the keyboard flag = false; } } and help anyways here is the block of code that throwing an exception for the test program: > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/5c8f7d68/attachment-0017.html From fire_baptized at hotmail.com Fri Apr 25 07:59:53 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 09:59:53 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Are there any examples of how to push out data? As in using input and output streams - if I can compare code maybe I can see where this is causing a problem. I have a byte array that I am pushing out data. I keep getting null pointer exceptions every where I turn. > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/22228ab6/attachment-0016.html From ajmas at sympatico.ca Sat Apr 26 07:37:09 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 26 Apr 2008 09:37:09 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hi, On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote: > > Are there any examples of how to push out data? As in using input > and output streams - if I can compare code maybe I can see where > this is causing a problem. I have a byte array that I am pushing > out data. I keep getting null pointer exceptions every where I turn. > There are some examples here that might be of help: http://rxtx.qbang.org/wiki/index.php/Examples Andre From fire_baptized at hotmail.com Sat Apr 26 20:13:54 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Sat, 26 Apr 2008 22:13:54 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: looked at those....yep didnt help - I need to push out data with GUI and not get a null pointer exception everytime I try. > CC: rxtx at qbang.org> From: ajmas at sympatico.ca> To: fire_baptized at hotmail.com> Subject: Re: [Rxtx] Serial Problems with Gui.....> Date: Sat, 26 Apr 2008 09:37:09 -0400> > Hi,> > > On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote:> >> > Are there any examples of how to push out data? As in using input > > and output streams - if I can compare code maybe I can see where > > this is causing a problem. I have a byte array that I am pushing > > out data. I keep getting null pointer exceptions every where I turn.> >> > There are some examples here that might be of help:> > http://rxtx.qbang.org/wiki/index.php/Examples> > Andre _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080426/09f95b41/attachment-0015.html From michael.erskine at ketech.com Mon Apr 28 02:47:22 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 28 Apr 2008 09:47:22 +0100 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D426EF3CBBC5@no-sv-03.ketech.local> Jesrael D. Summerhill wrote: > looked at those....yep didnt help - I need to push out data with GUI and > not get a null pointer exception everytime I try. So it seems pretty obvious that your code needs to check for nulls wherever one may occur and report what's happening. Alternatively, catch the npe and display the stack trace. Then you can fix your code so it doesn't try to work with something that ain't there. Regards, Michael Erskine. From scldad at sdc.com.au Mon Apr 28 03:58:34 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Mon, 28 Apr 2008 19:28:34 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Message-ID: <200804281928.34454.scldad@sdc.com.au> Has anybody done any design work on this? The first thing that springs to mind is that we still need to check for lock files because other apps tend to use that approach even if we go to ioctl. Cheers, Stephen Davies On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > Thanks Trent. > > Problem is only that I'm really not at all > Familiar with the C part of RXTX. If there > Were anything I could do in Java for this, > It would be easier for me.... > > ... Are there any C experts here on the list > Who'd like to look at ioctl port locking > For linux? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > -----Original Message----- > > From: Trent Jarvi [mailto:tjarvi at qbang.org] > > Sent: Donnerstag, 24. April 2008 04:32 > > To: Oberhuber, Martin > > Cc: rxtx at qbang.org > > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > > > I'm wondering what the status is with RXTX locking > > > serial ports on Linux? > > > > > > My understanding is that the mechanism used in > > > 2.1-7r2 (lockfiles) is not really state of the art, and > > > has lots of problems (e.g. missing permissions). > > > > > > There was an idea to migrate towards a Kernel > > > syscall based solution for port locking. > > > > > > What's the status here? > > > > Hi Martin, > > > > I'm in favor of deprecating the current FHS locking mechanism > > in favor of > > an IOCTL when available. I think it will be available on all the > > platforms but do not know for sure. > > > > The status is unchanged. I've had very few free cycles for > > such things. > > Feel free to take a stab at it if you have some time. I > > believe the IOCTL > > is used in the Mac OS X code already. > > > > I don't see any real backwards compatability issues and the > > IOCTL should > > just work. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Mon Apr 28 04:21:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 28 Apr 2008 04:21:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804281928.34454.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: I don't think there would need to be any architectural changes. A couple ifdefs and minor changes in the current code should be enough. Proposal: FHS/UUCP locks: continue to respect them, try to create them but do not error if the IOCTL is supported. (But does the IOCTL being defined mean it will work?) Enumeration: Do not assert the IOCTL while opening. Serial.open: assert the IOCTL after open. Continue to use locks as described above after asserting the IOCTL. If the IOCTL is defined but not working, handle it here. Failure cases include the IOCTL is not supported and the port is already locked. On Mon, 28 Apr 2008, Stephen Davies wrote: > Has anybody done any design work on this? > The first thing that springs to mind is that we still need to check for lock > files because other apps tend to use that approach even if we go to ioctl. > > Cheers, > Stephen Davies > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: >> Thanks Trent. >> >> Problem is only that I'm really not at all >> Familiar with the C part of RXTX. If there >> Were anything I could do in Java for this, >> It would be easier for me.... >> >> ... Are there any C experts here on the list >> Who'd like to look at ioctl port locking >> For linux? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >>> -----Original Message----- >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] >>> Sent: Donnerstag, 24. April 2008 04:32 >>> To: Oberhuber, Martin >>> Cc: rxtx at qbang.org >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? >>> >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: >>>> Dear RXTX community, >>>> >>>> I'm wondering what the status is with RXTX locking >>>> serial ports on Linux? >>>> >>>> My understanding is that the mechanism used in >>>> 2.1-7r2 (lockfiles) is not really state of the art, and >>>> has lots of problems (e.g. missing permissions). >>>> >>>> There was an idea to migrate towards a Kernel >>>> syscall based solution for port locking. >>>> >>>> What's the status here? >>> >>> Hi Martin, >>> >>> I'm in favor of deprecating the current FHS locking mechanism >>> in favor of >>> an IOCTL when available. I think it will be available on all the >>> platforms but do not know for sure. >>> >>> The status is unchanged. I've had very few free cycles for >>> such things. >>> Feel free to take a stab at it if you have some time. I >>> believe the IOCTL >>> is used in the Mac OS X code already. >>> >>> I don't see any real backwards compatability issues and the >>> IOCTL should >>> just work. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Tue Apr 29 12:04:04 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Apr 2008 20:04:04 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Hi all, The biggest problem that I have seen with lockfiles on Linux At least is, that it seems there is no standard with respect To the folder in which they should be created. Also, many Distributions seem to set up file system permissions in such A way that writing to the lockfile folder is not allowed for The normal user -- that's why we stopped using lockfiles In our commercial product. If we are to still respect lockfiles, we first need to Understand where we are expected to look for them. Does Anybody have any insight what variants of lockfile folder Schema exist out there in the wild? Some apps like minicom Seem to even allow users to manually specify a lockfile Folder of their choice. Because of the difficulty finding the right lockfile folder, And because of the inherent risk of thinking that something Might be locked while it actually isn't, I'd suggest that RXTX should have a "soft-off" feature that allows disabling ALL Lockfile checks at runtime without recompiling the native Sharedlibs. Trent - I like your strategy outline, but I think that it Needs to be configurable by the client such that users and/or Customer Support can disable lockfiles / disable ioctl in Case they detect that they are runing on an OS / Kernal that Does not support one or the other. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Montag, 28. April 2008 12:22 > To: Stephen Davies > Cc: rxtx at qbang.org; Oberhuber, Martin; Trent Jarvi > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > I don't think there would need to be any architectural > changes. A couple > ifdefs and minor changes in the current code should be enough. > > Proposal: > > FHS/UUCP locks: > continue to respect them, try to create them but do not error if > the IOCTL is supported. (But does the IOCTL being defined mean > it will work?) > Enumeration: > Do not assert the IOCTL while opening. > Serial.open: > assert the IOCTL after open. Continue to use locks as described > above after asserting the IOCTL. If the IOCTL is defined but > not working, handle it here. Failure cases include the IOCTL > is not supported and the port is already locked. > > On Mon, 28 Apr 2008, Stephen Davies wrote: > > > Has anybody done any design work on this? > > The first thing that springs to mind is that we still need > to check for lock > > files because other apps tend to use that approach even if > we go to ioctl. > > > > Cheers, > > Stephen Davies > > > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > >> Thanks Trent. > >> > >> Problem is only that I'm really not at all > >> Familiar with the C part of RXTX. If there > >> Were anything I could do in Java for this, > >> It would be easier for me.... > >> > >> ... Are there any C experts here on the list > >> Who'd like to look at ioctl port locking > >> For linux? > >> > >> Thanks, > >> -- > >> Martin Oberhuber, Senior Member of Technical Staff, Wind River > >> Target Management Project Lead, DSDP PMC Member > >> http://www.eclipse.org/dsdp/tm > >> > >>> -----Original Message----- > >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] > >>> Sent: Donnerstag, 24. April 2008 04:32 > >>> To: Oberhuber, Martin > >>> Cc: rxtx at qbang.org > >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? > >>> > >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > >>>> Dear RXTX community, > >>>> > >>>> I'm wondering what the status is with RXTX locking > >>>> serial ports on Linux? > >>>> > >>>> My understanding is that the mechanism used in > >>>> 2.1-7r2 (lockfiles) is not really state of the art, and > >>>> has lots of problems (e.g. missing permissions). > >>>> > >>>> There was an idea to migrate towards a Kernel > >>>> syscall based solution for port locking. > >>>> > >>>> What's the status here? > >>> > >>> Hi Martin, > >>> > >>> I'm in favor of deprecating the current FHS locking mechanism > >>> in favor of > >>> an IOCTL when available. I think it will be available on all the > >>> platforms but do not know for sure. > >>> > >>> The status is unchanged. I've had very few free cycles for > >>> such things. > >>> Feel free to take a stab at it if you have some time. I > >>> believe the IOCTL > >>> is used in the Mac OS X code already. > >>> > >>> I don't see any real backwards compatability issues and the > >>> IOCTL should > >>> just work. > >>> > >>> -- > >>> Trent Jarvi > >>> tjarvi at qbang.org > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > From Steffen.DETTMER at ingenico.com Tue Apr 29 13:34:44 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 29 Apr 2008 21:34:44 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Message-ID: <20080429193444.GU2928@elberon.bln.de.ingenico.com> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > The biggest problem that I have seen with lockfiles on Linux > At least is, that it seems there is no standard with respect > To the folder in which they should be created. Also, many > Distributions seem to set up file system permissions in such > A way that writing to the lockfile folder is not allowed for > The normal user -- that's why we stopped using lockfiles > In our commercial product. It seems it depends on the expectations. I consider it as a feature that by default a linux user cannot access serial ports. Maybe root connected a modem (can produce phone bills) or even some serial card reader, maybe with the web servers key pair. I would expect that by default a user cannot open the serial port because of insufficient permissions on the device file. I would expect this on other unices as well (but I don't know it). For windows I think it should be similar but not impacting so much in practice, because often windows users work with big permissions on a somewhat high priviledge level or even Administrator. > If we are to still respect lockfiles, we first need to > Understand where we are expected to look for them. Does > Anybody have any insight what variants of lockfile folder > Schema exist out there in the wild? Some apps like minicom > Seem to even allow users to manually specify a lockfile > Folder of their choice. At least my (ancient) minicom does not allow the user to change this option, it is displayed but read-only, but root is allowed to change it. > Because of the difficulty finding the right lockfile folder, > And because of the inherent risk of thinking that something > Might be locked while it actually isn't, I'd suggest that > RXTX should have a "soft-off" feature that allows disabling > ALL Lockfile checks at runtime without recompiling the native > Sharedlibs. sounds very reasonable, yes... and as admin I would not wish that users could skip such locking because they do things wrong by default ;) (in the end I guess that is related to the dilemma, that hotplug/user-owned-periphery and multi-user systems simply conflict) > Trent - I like your strategy outline, but I think that it > Needs to be configurable by the client such that users and/or > Customer Support can disable lockfiles / disable ioctl in > Case they detect that they are runing on an OS / Kernal that > Does not support one or the other. Yes, this would be good I guess... Applications could offer configuration options to control that, maybe similarily as minicom. BTW, man minicom tells: *B - Lock file location On most systems This should be /usr/spool/uucp. Linux systems use /var/lock. If this directory does not exist, minicom will not attempt to use lockfiles. The statement `Linux systems use /var/lock' is interesting, does anyone know the source of this convention? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Tue Apr 29 16:11:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Apr 2008 16:11:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? These details are outlined in the Filesystem Hierarchy Standard (FHS). http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLOCKLOCKFILES -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Tue Apr 29 18:58:09 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Wed, 30 Apr 2008 10:28:09 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: <200804301028.09307.scldad@sdc.com.au> I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is the same. Any ideas as to how to handle this? Stephen On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: > * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > > The biggest problem that I have seen with lockfiles on Linux > > At least is, that it seems there is no standard with respect > > To the folder in which they should be created. Also, many > > Distributions seem to set up file system permissions in such > > A way that writing to the lockfile folder is not allowed for > > The normal user -- that's why we stopped using lockfiles > > In our commercial product. > > It seems it depends on the expectations. I consider it as a > feature that by default a linux user cannot access serial ports. > Maybe root connected a modem (can produce phone bills) or even > some serial card reader, maybe with the web servers key pair. > > I would expect that by default a user cannot open the serial port > because of insufficient permissions on the device file. I would > expect this on other unices as well (but I don't know it). > > For windows I think it should be similar but not impacting so > much in practice, because often windows users work with big > permissions on a somewhat high priviledge level or even > Administrator. > > > If we are to still respect lockfiles, we first need to > > Understand where we are expected to look for them. Does > > Anybody have any insight what variants of lockfile folder > > Schema exist out there in the wild? Some apps like minicom > > Seem to even allow users to manually specify a lockfile > > Folder of their choice. > > At least my (ancient) minicom does not allow the user to change > this option, it is displayed but read-only, but root is allowed > to change it. > > > Because of the difficulty finding the right lockfile folder, > > And because of the inherent risk of thinking that something > > Might be locked while it actually isn't, I'd suggest that > > RXTX should have a "soft-off" feature that allows disabling > > ALL Lockfile checks at runtime without recompiling the native > > Sharedlibs. > > sounds very reasonable, yes... > and as admin I would not wish that users could skip such > locking because they do things wrong by default ;) > > (in the end I guess that is related to the dilemma, that > hotplug/user-owned-periphery and multi-user systems simply > conflict) > > > Trent - I like your strategy outline, but I think that it > > Needs to be configurable by the client such that users and/or > > Customer Support can disable lockfiles / disable ioctl in > > Case they detect that they are runing on an OS / Kernal that > > Does not support one or the other. > > Yes, this would be good I guess... Applications could offer > configuration options to control that, maybe similarily as > minicom. > > BTW, man minicom tells: > > *B - Lock file location > On most systems This should be /usr/spool/uucp. > Linux systems use /var/lock. If this directory > does not exist, minicom will not attempt to use > lockfiles. > > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure > and expedient electronic transaction acceptance. Ingenico products leverage > proven technology, established standards and unparalleled ergonomics to > provide optimal reliability, versatility and usability. This comprehensive > range of products is complemented by a global array of services and > partnerships, enabling businesses in a number of vertical sectors to accept > transactions anywhere their business takes them. www.ingenico.com This > message may contain confidential and/or privileged information. If you are > not the addressee or authorized to receive this for the addressee, you must > not use, copy, disclose or take any action based on this message or any > information herein. If you have received this message in error, please > advise the sender immediately by reply e-mail and delete this message. > Thank you for your cooperation. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Wed Apr 30 19:30:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 30 Apr 2008 19:30:51 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804301028.09307.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> <200804301028.09307.scldad@sdc.com.au> Message-ID: Hi Stephen, I suspect ioctl/TIOCEXCL open/O_EXCL would do the job. Mac uses TIOCEXCL and it is POSIX. We use O_EXCL for lockfiles on Linux already. On Wed, 30 Apr 2008, Stephen Davies wrote: > I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is > the same. > > Any ideas as to how to handle this? > > Stephen > > > On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: >> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: >>> The biggest problem that I have seen with lockfiles on Linux >>> At least is, that it seems there is no standard with respect >>> To the folder in which they should be created. Also, many >>> Distributions seem to set up file system permissions in such >>> A way that writing to the lockfile folder is not allowed for >>> The normal user -- that's why we stopped using lockfiles >>> In our commercial product. >> >> It seems it depends on the expectations. I consider it as a >> feature that by default a linux user cannot access serial ports. >> Maybe root connected a modem (can produce phone bills) or even >> some serial card reader, maybe with the web servers key pair. >> >> I would expect that by default a user cannot open the serial port >> because of insufficient permissions on the device file. I would >> expect this on other unices as well (but I don't know it). >> >> For windows I think it should be similar but not impacting so >> much in practice, because often windows users work with big >> permissions on a somewhat high priviledge level or even >> Administrator. >> >>> If we are to still respect lockfiles, we first need to >>> Understand where we are expected to look for them. Does >>> Anybody have any insight what variants of lockfile folder >>> Schema exist out there in the wild? Some apps like minicom >>> Seem to even allow users to manually specify a lockfile >>> Folder of their choice. >> >> At least my (ancient) minicom does not allow the user to change >> this option, it is displayed but read-only, but root is allowed >> to change it. >> >>> Because of the difficulty finding the right lockfile folder, >>> And because of the inherent risk of thinking that something >>> Might be locked while it actually isn't, I'd suggest that >>> RXTX should have a "soft-off" feature that allows disabling >>> ALL Lockfile checks at runtime without recompiling the native >>> Sharedlibs. >> >> sounds very reasonable, yes... >> and as admin I would not wish that users could skip such >> locking because they do things wrong by default ;) >> >> (in the end I guess that is related to the dilemma, that >> hotplug/user-owned-periphery and multi-user systems simply >> conflict) >> >>> Trent - I like your strategy outline, but I think that it >>> Needs to be configurable by the client such that users and/or >>> Customer Support can disable lockfiles / disable ioctl in >>> Case they detect that they are runing on an OS / Kernal that >>> Does not support one or the other. >> >> Yes, this would be good I guess... Applications could offer >> configuration options to control that, maybe similarily as >> minicom. >> >> BTW, man minicom tells: >> >> *B - Lock file location >> On most systems This should be /usr/spool/uucp. >> Linux systems use /var/lock. If this directory >> does not exist, minicom will not attempt to use >> lockfiles. >> >> The statement `Linux systems use /var/lock' is interesting, does >> anyone know the source of this convention? >> >> oki, >> >> Steffen >> >> About Ingenico Throughout the world businesses rely on Ingenico for secure >> and expedient electronic transaction acceptance. Ingenico products leverage >> proven technology, established standards and unparalleled ergonomics to >> provide optimal reliability, versatility and usability. This comprehensive >> range of products is complemented by a global array of services and >> partnerships, enabling businesses in a number of vertical sectors to accept >> transactions anywhere their business takes them. www.ingenico.com This >> message may contain confidential and/or privileged information. If you are >> not the addressee or authorized to receive this for the addressee, you must >> not use, copy, disclose or take any action based on this message or any >> information herein. If you have received this message in error, please >> advise the sender immediately by reply e-mail and delete this message. >> Thank you for your cooperation. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0041.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0039.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0026.html From pboulton at pulsetracer.com Fri Apr 18 14:30:13 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Fri, 18 Apr 2008 13:30:13 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site Message-ID: <480904D5.1060307@pulsetracer.com> Hello, gentle serial porters. I have downloaded the zipped up binaries for use on Windows without Sun's CommAPI, but don't seem able to extract anything from the download. Go to main page, http://www.rxtx.org/ Click on Downloads I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) And I save it to disk. If I try and extract the files with WinZip, Winzip thinks the archive is corrupt. If I try using Windows Explorer, I am able to extract it into a single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than the original .zip. Any help would be much appreciated. Sincerely, Philip Boulton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080418/97d89793/attachment-0024.html From tjarvi at qbang.org Fri Apr 18 19:07:00 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 18 Apr 2008 19:07:00 -0600 (MDT) Subject: [Rxtx] Difficulty opening zip file at rxtx site In-Reply-To: <480904D5.1060307@pulsetracer.com> References: <480904D5.1060307@pulsetracer.com> Message-ID: On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org From pboulton at pulsetracer.com Sat Apr 19 12:46:26 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Sat, 19 Apr 2008 11:46:26 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site References: <480904D5.1060307@pulsetracer.com> Message-ID: <53DB7576450695419E09299104043761A78533@ZTGSERVER.ztg.local> I have been able to get my hands on the binaries, by going to the ftp directory /pub/rxtx at ftp.qbang.org,, and ftping the file rxtx-2.1-7-bins-r2.zip . This opens happily with Winzip, and extracts as the set of files that you describe below. I only experience the ill-formed archive problem by clicking the link on the rxtx.org Downloads page (http://rxtx.qbang.org/pub/rxtx/ rxtx-2.1-7-bins-r2.zip ). Not sure what to make of that. Philip Boulton ________________________________ From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Fri 4/18/2008 6:07 PM To: Philip Boulton Cc: rxtx at qbang.org Subject: Re: [Rxtx] Difficulty opening zip file at rxtx site On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080419/147923bb/attachment-0023.html From jlar310 at gmail.com Sat Apr 19 19:11:55 2008 From: jlar310 at gmail.com (Jeff Larsen) Date: Sat, 19 Apr 2008 20:11:55 -0500 Subject: [Rxtx] Moxa serial over Ethernet driver Message-ID: Hi all, I've been using javax.comm for years to communicate with a legacy radio data system. We want to migrate the java side of the system to a VMware Server virtual machine. We've had great success using Moxa DE-303 and 5610 serial over Ethernet appliances and virtual machines for running hylafax. The OS (Linux in this case) uses a kernel driver to communicate with the Moxa via a virtual serial port such as /dev/ttyr00. I want to do the same thing with javax.comm or gnu.io to connect to a virtual serial port. However I'm hitting road blocks everywhere. javax.comm for Linux sees the virtual port, but there are transmission errors. Tried Solaris too, but the Solaris Moxa drivers don't play nice with javax.comm because the driver uses /dev/pts/n instead of /dev/term/x. Next I tried RXTX on Linux, but I'm getting NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX on Solaris. Has anyone used RXTX with serial over Ethernet devices? Any hints on how to make it work? I know that I'm not completely off track because javax.comm does work with Moxa on a Windows platform, but that's just not an option for production deployment. -- Jeff From tjarvi at qbang.org Sat Apr 19 21:08:41 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 19 Apr 2008 21:08:41 -0600 (MDT) Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: yOn Sat, 19 Apr 2008, Jeff Larsen wrote: > Hi all, > > I've been using javax.comm for years to communicate with a legacy > radio data system. We want to migrate the java side of the system to a > VMware Server virtual machine. We've had great success using Moxa > DE-303 and 5610 serial over Ethernet appliances and virtual machines > for running hylafax. The OS (Linux in this case) uses a kernel driver > to communicate with the Moxa via a virtual serial port such as > /dev/ttyr00. > > I want to do the same thing with javax.comm or gnu.io to connect to a > virtual serial port. However I'm hitting road blocks everywhere. > javax.comm for Linux sees the virtual port, but there are transmission > errors. Tried Solaris too, but the Solaris Moxa drivers don't play > nice with javax.comm because the driver uses /dev/pts/n instead of > /dev/term/x. Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris. > > Has anyone used RXTX with serial over Ethernet devices? Any hints on > how to make it work? > > I know that I'm not completely off track because javax.comm does work > with Moxa on a Windows platform, but that's just not an option for > production deployment. > > Moxa should work under linux. There may be minor issues depending upon how complete the kernel driver is but I think it will work. One of the minor issues is /dev/ttyr00 is not enumerated. There are several work arounds documented with the source code and on the wiki. The easiest solution for testing purposes is to make a symbolic link from /dev/ttyr00 to a port that is enumerated such as /dev/ttyS129. You can later alter the rxtx source or use properties to change the enumerated ports. -- Trent Jarvi tjarvi at qbang.org From d.tonhofer at m-plify.com Sun Apr 20 03:33:30 2008 From: d.tonhofer at m-plify.com (David Tonhofer (M-PLIFY S.A.)) Date: Sun, 20 Apr 2008 11:33:30 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: <480B0DEA.5010908@m-plify.com> Jeff Larsen wrote: > Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris It might be that the Java side of RXTX does not recognize that portname. Trying modifying src/RXTXCommDriver.java as described in this case: http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card From ajmas at sympatico.ca Sun Apr 20 16:37:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Apr 2008 18:37:59 -0400 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <480B0DEA.5010908@m-plify.com> References: <480B0DEA.5010908@m-plify.com> Message-ID: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > Jeff Larsen wrote: >> Next I tried RXTX on Linux, but I'm getting >> NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX >> on Solaris > It might be that the Java side of RXTX does not recognize that > portname. > Trying modifying src/RXTXCommDriver.java as described in this case: > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card I wonder whether it would be worth allowing custom port prefixes as a system parameter? For example: gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" Andre From Martin.Oberhuber at windriver.com Tue Apr 22 12:34:36 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 22 Apr 2008 20:34:36 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> References: <480B0DEA.5010908@m-plify.com> <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE6485848056CD6CE@ism-mail03.corp.ad.wrs.com> Sounds like a great idea... I'm wondering how the "variable part" after the Prefixes could be specified though? What about allowing Regular Expression character Classes in the existing System Property for specifying ports: System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyS[0-9],ttyS[ABC],ttyUSB[0-9a-z]"); The set of allowed patterns would of course need to Be restricted compared to REGEX, because it must be A syntax that supports iterating over it. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Montag, 21. April 2008 00:38 > To: rxtx at qbang.org and Users > Subject: Re: [Rxtx] Moxa serial over Ethernet driver > > > On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > > Jeff Larsen wrote: > >> Next I tried RXTX on Linux, but I'm getting > >> NoSuchPortException connecting to /dev/ttyr00. I have yet > to try RXTX > >> on Solaris > > It might be that the Java side of RXTX does not recognize that > > portname. > > Trying modifying src/RXTXCommDriver.java as described in this case: > > > > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_ > SST-4P.2FLP_multiport_card > > I wonder whether it would be worth allowing custom port > prefixes as a > system parameter? For > example: > > gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Loi.TRAN at weatherford.com Tue Apr 22 13:10:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Tue, 22 Apr 2008 14:10:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled Message-ID: Hi, I'm currently using the Java RXTX API to interface to a serial port. The serial port is connected to a bridge board that communicates with our communications system running at 1.875 Mbps which is linked to an embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no flow control). I send a command to the embedded board through the serial-bridge board which then is relayed to the embedded board. The command sent asks the embedded board to dump a binary image. Here's where I'm hitting some problems. I've successfully done this is an integrated serial port from the laptop. The binary file that comes back is consistent on every attempt. When I use the application I've written to do the same thing with a USB-to-serial adapter, the image I get back is not the same as the image I receive through the USB-to-serial adapter is not consistent at all. A final thing is that when I use a terminal program to dump the binary image with the USB-serial adapter, the image is correct. Every time! What is the terminal program doing that's not being done in my application? My application is quite simple. Has anyone observed this behavior before? If you have, I'd like to know how you've gotten around this problem. Thanks, LT =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From tjarvi at qbang.org Tue Apr 22 21:11:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 22 Apr 2008 21:11:10 -0600 (MDT) Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org From Loi.TRAN at weatherford.com Wed Apr 23 08:35:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Wed, 23 Apr 2008 09:35:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: Thanks for all the responses. I finally tried something that worked consistently. I updated my Prolific driver and repeated my tests. It worked. If you're using the Prolific type USB-serial adapters, do no use the Prolific version 2.0.2.1 driver on Windows. Update it to the latest 2.0.2.8 version. Again, thanks for all the responses. LT -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Tuesday, April 22, 2008 10:11 PM To: TRAN, Loi X. Cc: rxtx at qbang.org Subject: Re: [Rxtx] Prolific USB - RXTX data mangled On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From Martin.Oberhuber at windriver.com Wed Apr 23 18:54:26 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 02:54:26 +0200 Subject: [Rxtx] RXTX port locking on Linux status? Message-ID: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Dear RXTX community, I'm wondering what the status is with RXTX locking serial ports on Linux? My understanding is that the mechanism used in 2.1-7r2 (lockfiles) is not really state of the art, and has lots of problems (e.g. missing permissions). There was an idea to migrate towards a Kernel syscall based solution for port locking. What's the status here? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/9878db9f/attachment-0019.html From tjarvi at qbang.org Wed Apr 23 20:32:24 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Apr 2008 20:32:24 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > Dear RXTX community, > > I'm wondering what the status is with RXTX locking > serial ports on Linux? > > My understanding is that the mechanism used in > 2.1-7r2 (lockfiles) is not really state of the art, and > has lots of problems (e.g. missing permissions). > > There was an idea to migrate towards a Kernel > syscall based solution for port locking. > > What's the status here? > Hi Martin, I'm in favor of deprecating the current FHS locking mechanism in favor of an IOCTL when available. I think it will be available on all the platforms but do not know for sure. The status is unchanged. I've had very few free cycles for such things. Feel free to take a stab at it if you have some time. I believe the IOCTL is used in the Mac OS X code already. I don't see any real backwards compatability issues and the IOCTL should just work. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Apr 24 06:14:06 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 14:14:06 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Thanks Trent. Problem is only that I'm really not at all Familiar with the C part of RXTX. If there Were anything I could do in Java for this, It would be easier for me.... ... Are there any C experts here on the list Who'd like to look at ioctl port locking For linux? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Donnerstag, 24. April 2008 04:32 > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > I'm wondering what the status is with RXTX locking > > serial ports on Linux? > > > > My understanding is that the mechanism used in > > 2.1-7r2 (lockfiles) is not really state of the art, and > > has lots of problems (e.g. missing permissions). > > > > There was an idea to migrate towards a Kernel > > syscall based solution for port locking. > > > > What's the status here? > > > > Hi Martin, > > I'm in favor of deprecating the current FHS locking mechanism > in favor of > an IOCTL when available. I think it will be available on all the > platforms but do not know for sure. > > The status is unchanged. I've had very few free cycles for > such things. > Feel free to take a stab at it if you have some time. I > believe the IOCTL > is used in the Mac OS X code already. > > I don't see any real backwards compatability issues and the > IOCTL should > just work. > > -- > Trent Jarvi > tjarvi at qbang.org > From sspies at sloc.de Thu Apr 24 07:15:36 2008 From: sspies at sloc.de (Sebastian Spies) Date: Thu, 24 Apr 2008 15:15:36 +0200 (CEST) Subject: [Rxtx] rxtx on gumstix: Interrupted system call In-Reply-To: <47FB7B20.7080504@sloc.de> References: <47FB7B20.7080504@sloc.de> Message-ID: <55445.130.83.139.205.1209042936.squirrel@ssl.sloc.de> Dear list, while porting rxtx to the gumstix, I found out, that select used in readArray in SerialImp.c might not work as expected. Maybe, because of missing TIOCSERGETLSR-support? select is often interrupted, so i wrote the following quick'n'dirty hack to make it work on gumstix: diff -Nur rxtx-2.1-7r2/src/SerialImp.c rxtx-2.1-7r2/src/SerialImp.c --- rxtx-2.1-7r2/src/SerialImp.c 2006-01-29 23:19:04.000000000 +0100 +++ rxtx-2.1-7r2-patched/src/SerialImp.c 2008-04-24 14:30:17.000000000 +0200 @@ -3380,7 +3381,7 @@ JNIEXPORT jint JNICALL RXTXPort(readArray)( JNIEnv *env, jobject jobj, jbyteArray jbarray, jint offset, jint length ) { - int bytes; + int bytes = 0; jbyte *body; /* char msg[80]; */ int fd = get_java_var( env, jobj, "fd", "I" ); @@ -3397,9 +3398,18 @@ "readArray", "Invalid length" ); return -1; } - body = (*env)->GetByteArrayElements( env, jbarray, 0 ); - bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ - (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + while(1 > bytes) + { + body = (*env)->GetByteArrayElements( env, jbarray, 0 ); + bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ + (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + // quick'n'dirty - SSP + report (" trying again... \n"); + errno = 0; + } + if( bytes < 0 ) { report( "RXTXPort:readArray bytes < 0" ); LEAVE( "RXTXPort:readArray" ); > Hey, > > I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use > RXTXPort$SerialInputStream.read(), then I get the following Exception. I > did not yet figure out which system call is interrupted as strace > produces loads of output. > > Any help would be very appreciated. Thanks in advance. > Sebastian > > > [java] java.io.IOException: Interrupted system call in readArray > [java] at gnu.io.RXTXPort.readArray(Native Method) > [java] at > gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) > [java] at > java.io.FilterInputStream.read(FilterInputStream.java:189) > [java] at > java.io.BufferedInputStream.refill(BufferedInputStream.java:371) > [java] at > java.io.BufferedInputStream.read(BufferedInputStream.java:229) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) > [java] at > com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) > > -- > Sebastian Spies > > mail: sspies at sloc.de > > > > From fire_baptized at hotmail.com Thu Apr 24 18:27:48 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Thu, 24 Apr 2008 20:27:48 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hello I am having a problem with the serial device connecting (software wise) to the serial port. However I have a test program and it seems to work just fine in that environment - and it doesnt use GUI. The error I am getting is : PortNotFoundException Now the way I have it setup in the GUI environment is that once the user pushes a JButton the program connects using this class: protected void establishConnection() { try { portId = CommPortIdentifier.getPortIdentifier("COM3"); System.out.println("Establishing connction....."); messages[0] = "\nEstablishing connction.....\n"; } catch ( NoSuchPortException noport) { System.out.println("Port not found: "+ noport); messages[0] = "Port not found: "+ noport+"\n"; } try { serialPort = (SerialPort) portId.open("serial", 50); System.out.println("Port has been found."); messages[1] = "Port has been found.\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[1] = "" +usedport; } try { serialPort = (SerialPort) portId.open("serial", 50); messages[2] = "Connecting to COM3 on port 50....\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; } try { serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); System.out.println("Esablishing the transfer rate settings for COM3."); messages[3] = "Esablishing the transfer rate settings for COM3.\n"; } catch (UnsupportedCommOperationException nosupcom) { System.out.println(nosupcom); System.out.println("The tranfer rate could not be esblished on COM3."); messages[3] = "The tranfer rate could not be esblished on COM3.\n"; } System.out.println(serialPort.getFlowControlMode()); messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; //sendDataOut(buffer[3],buffer[4]); } I need all the data in this method (and all the string values in this method) to be printed out on a JTextArea. I wont do me any good if not all the text is printed on a JTextArea in another class. So I have the text printing the JTextArea correctly, but everytime the JButton is activated - it gives me that error message. I did add a disconnect button that is supposed to call the serialPort.close(). _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/273fd4ec/attachment-0018.html From tjarvi at qbang.org Thu Apr 24 21:54:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Apr 2008 21:54:10 -0600 (MDT) Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > Hello I am having a problem with the serial device connecting (software > wise) to the serial port. However I have a test program and it seems to > work just fine in that environment - and it doesnt use GUI. The error I > am getting is : PortNotFoundException Now the way I have it setup in the > GUI environment is that once the user pushes a JButton the program > connects using this class: > > protected void establishConnection() { > try { > portId = CommPortIdentifier.getPortIdentifier("COM3"); > System.out.println("Establishing connction....."); > messages[0] = "\nEstablishing connction.....\n"; > } > catch ( NoSuchPortException noport) { > System.out.println("Port not found: "+ noport); > messages[0] = "Port not found: "+ noport+"\n"; > } > try { > serialPort = (SerialPort) portId.open("serial", 50); > System.out.println("Port has been found."); > messages[1] = "Port has been found.\n"; > } > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[1] = "" +usedport; > } ================================================================= > try { > serialPort = (SerialPort) portId.open("serial", 50); > messages[2] = "Connecting to COM3 on port 50....\n"; > } ================================================================== > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > } > try { > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > System.out.println("Esablishing the transfer rate settings for COM3."); > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > } > catch (UnsupportedCommOperationException nosupcom) { > System.out.println(nosupcom); > System.out.println("The tranfer rate could not be esblished on COM3."); > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > } > System.out.println(serialPort.getFlowControlMode()); > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > //sendDataOut(buffer[3],buffer[4]); > } > > I need all the data in this method (and all the string values in this > method) to be printed out on a JTextArea. I wont do me any good if not > all the text is printed on a JTextArea in another class. So I have the > text printing the JTextArea correctly, but everytime the JButton is > activated - it gives me that error message. I did add a disconnect > button that is supposed to call the serialPort.close(). > The open code used twice is going to throw an exception. It may be that you catch the exception above this code and print a confusing message? A common mistake is people will accidently run two copies of their program. The first instance of the program will open the port and prevent enumeration (finding the port) in the second instance of the program. As an example, you may be running your text based application which is preventing the GUI from seeing the port. Enumeration is done by trying to open the port. If the port is open, Enumeration fails. -- Trent Jarvi tjarvi at qbang.org From fire_baptized at hotmail.com Thu Apr 24 22:32:05 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 00:32:05 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Wow - thanks dude what a dumb thing for me to not catch..... now here is the current problem - right now I am trying to output data again one is with the test program - and it seems that serialPort.setRTS(true); is throwing an exceptions there - now if I show this code please bare in mind that I am only testing - the code is kinda sloppy in my mind - but if I can figure out why calling this function is throwing an exception then maybe I can figure out why my GUI application is getting the same null pointer exceptions when try to send out the data stream. FYI Trent this email is not directed towards you - anyone can jump in on this public static void main(String args[]) { byte[] b = new byte[64]; int keyinput = 0 ; byte x = 0; byte y = 0; PortTesting1 testports = new PortTesting1(); try { joyskoro = Joystick.createInstance(); } catch (IOException ioexc) { System.out.println("There is an input/output problem: " + ioexc); } while (true) { joyskoro.poll(); b[0] = ((byte) -(10 * joyskoro.getY())); b[1] = ((byte) (10 * joyskoro.getX())); System.out.println("The 3rd byte is: " +b[0]); System.out.println("The 4rd byte is: " +b[1]); serialPort.setRTS(true); // HERE IS WHERE THE PROBLEM IS !!!!!!! ON THIS LINE but if I dont have it active in my program the Bluetooth device (that is System.out.println("Ready to send :-) !"); //connected to the serial port does not send out data!!!!! if (joyskoro.isButtonDown(joyskoro.BUTTON10)) { System.out.println("Connection terminated."); serialPort.close(); break; } if (joyskoro.isButtonDown(joyskoro.BUTTON2)) { boolean flag = true; //reading from key input from the keyboard System.out.println("Please input a command: "); while (flag) { try { keyinput = System.in.read(); } catch (IOException ioexc) {/*there is no need to put * anything here */ } if((char)keyinput=='w') { pushIt((byte)85); } if((char)keyinput=='s') { pushIt((byte)84); } if((char)keyinput=='a') { pushIt((byte)83); } if((char)keyinput=='d') { pushIt((byte)82); } if((char)keyinput=='q') { pushIt((byte)89); } if((char)keyinput=='\t') { //this stop reading input from the keyboard flag = false; } } and help anyways here is the block of code that throwing an exception for the test program: > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/5c8f7d68/attachment-0018.html From fire_baptized at hotmail.com Fri Apr 25 07:59:53 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 09:59:53 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Are there any examples of how to push out data? As in using input and output streams - if I can compare code maybe I can see where this is causing a problem. I have a byte array that I am pushing out data. I keep getting null pointer exceptions every where I turn. > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/22228ab6/attachment-0017.html From ajmas at sympatico.ca Sat Apr 26 07:37:09 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 26 Apr 2008 09:37:09 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hi, On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote: > > Are there any examples of how to push out data? As in using input > and output streams - if I can compare code maybe I can see where > this is causing a problem. I have a byte array that I am pushing > out data. I keep getting null pointer exceptions every where I turn. > There are some examples here that might be of help: http://rxtx.qbang.org/wiki/index.php/Examples Andre From fire_baptized at hotmail.com Sat Apr 26 20:13:54 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Sat, 26 Apr 2008 22:13:54 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: looked at those....yep didnt help - I need to push out data with GUI and not get a null pointer exception everytime I try. > CC: rxtx at qbang.org> From: ajmas at sympatico.ca> To: fire_baptized at hotmail.com> Subject: Re: [Rxtx] Serial Problems with Gui.....> Date: Sat, 26 Apr 2008 09:37:09 -0400> > Hi,> > > On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote:> >> > Are there any examples of how to push out data? As in using input > > and output streams - if I can compare code maybe I can see where > > this is causing a problem. I have a byte array that I am pushing > > out data. I keep getting null pointer exceptions every where I turn.> >> > There are some examples here that might be of help:> > http://rxtx.qbang.org/wiki/index.php/Examples> > Andre _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080426/09f95b41/attachment-0016.html From michael.erskine at ketech.com Mon Apr 28 02:47:22 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 28 Apr 2008 09:47:22 +0100 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D426EF3CBBC5@no-sv-03.ketech.local> Jesrael D. Summerhill wrote: > looked at those....yep didnt help - I need to push out data with GUI and > not get a null pointer exception everytime I try. So it seems pretty obvious that your code needs to check for nulls wherever one may occur and report what's happening. Alternatively, catch the npe and display the stack trace. Then you can fix your code so it doesn't try to work with something that ain't there. Regards, Michael Erskine. From scldad at sdc.com.au Mon Apr 28 03:58:34 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Mon, 28 Apr 2008 19:28:34 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Message-ID: <200804281928.34454.scldad@sdc.com.au> Has anybody done any design work on this? The first thing that springs to mind is that we still need to check for lock files because other apps tend to use that approach even if we go to ioctl. Cheers, Stephen Davies On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > Thanks Trent. > > Problem is only that I'm really not at all > Familiar with the C part of RXTX. If there > Were anything I could do in Java for this, > It would be easier for me.... > > ... Are there any C experts here on the list > Who'd like to look at ioctl port locking > For linux? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > -----Original Message----- > > From: Trent Jarvi [mailto:tjarvi at qbang.org] > > Sent: Donnerstag, 24. April 2008 04:32 > > To: Oberhuber, Martin > > Cc: rxtx at qbang.org > > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > > > I'm wondering what the status is with RXTX locking > > > serial ports on Linux? > > > > > > My understanding is that the mechanism used in > > > 2.1-7r2 (lockfiles) is not really state of the art, and > > > has lots of problems (e.g. missing permissions). > > > > > > There was an idea to migrate towards a Kernel > > > syscall based solution for port locking. > > > > > > What's the status here? > > > > Hi Martin, > > > > I'm in favor of deprecating the current FHS locking mechanism > > in favor of > > an IOCTL when available. I think it will be available on all the > > platforms but do not know for sure. > > > > The status is unchanged. I've had very few free cycles for > > such things. > > Feel free to take a stab at it if you have some time. I > > believe the IOCTL > > is used in the Mac OS X code already. > > > > I don't see any real backwards compatability issues and the > > IOCTL should > > just work. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Mon Apr 28 04:21:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 28 Apr 2008 04:21:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804281928.34454.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: I don't think there would need to be any architectural changes. A couple ifdefs and minor changes in the current code should be enough. Proposal: FHS/UUCP locks: continue to respect them, try to create them but do not error if the IOCTL is supported. (But does the IOCTL being defined mean it will work?) Enumeration: Do not assert the IOCTL while opening. Serial.open: assert the IOCTL after open. Continue to use locks as described above after asserting the IOCTL. If the IOCTL is defined but not working, handle it here. Failure cases include the IOCTL is not supported and the port is already locked. On Mon, 28 Apr 2008, Stephen Davies wrote: > Has anybody done any design work on this? > The first thing that springs to mind is that we still need to check for lock > files because other apps tend to use that approach even if we go to ioctl. > > Cheers, > Stephen Davies > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: >> Thanks Trent. >> >> Problem is only that I'm really not at all >> Familiar with the C part of RXTX. If there >> Were anything I could do in Java for this, >> It would be easier for me.... >> >> ... Are there any C experts here on the list >> Who'd like to look at ioctl port locking >> For linux? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >>> -----Original Message----- >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] >>> Sent: Donnerstag, 24. April 2008 04:32 >>> To: Oberhuber, Martin >>> Cc: rxtx at qbang.org >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? >>> >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: >>>> Dear RXTX community, >>>> >>>> I'm wondering what the status is with RXTX locking >>>> serial ports on Linux? >>>> >>>> My understanding is that the mechanism used in >>>> 2.1-7r2 (lockfiles) is not really state of the art, and >>>> has lots of problems (e.g. missing permissions). >>>> >>>> There was an idea to migrate towards a Kernel >>>> syscall based solution for port locking. >>>> >>>> What's the status here? >>> >>> Hi Martin, >>> >>> I'm in favor of deprecating the current FHS locking mechanism >>> in favor of >>> an IOCTL when available. I think it will be available on all the >>> platforms but do not know for sure. >>> >>> The status is unchanged. I've had very few free cycles for >>> such things. >>> Feel free to take a stab at it if you have some time. I >>> believe the IOCTL >>> is used in the Mac OS X code already. >>> >>> I don't see any real backwards compatability issues and the >>> IOCTL should >>> just work. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Tue Apr 29 12:04:04 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Apr 2008 20:04:04 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Hi all, The biggest problem that I have seen with lockfiles on Linux At least is, that it seems there is no standard with respect To the folder in which they should be created. Also, many Distributions seem to set up file system permissions in such A way that writing to the lockfile folder is not allowed for The normal user -- that's why we stopped using lockfiles In our commercial product. If we are to still respect lockfiles, we first need to Understand where we are expected to look for them. Does Anybody have any insight what variants of lockfile folder Schema exist out there in the wild? Some apps like minicom Seem to even allow users to manually specify a lockfile Folder of their choice. Because of the difficulty finding the right lockfile folder, And because of the inherent risk of thinking that something Might be locked while it actually isn't, I'd suggest that RXTX should have a "soft-off" feature that allows disabling ALL Lockfile checks at runtime without recompiling the native Sharedlibs. Trent - I like your strategy outline, but I think that it Needs to be configurable by the client such that users and/or Customer Support can disable lockfiles / disable ioctl in Case they detect that they are runing on an OS / Kernal that Does not support one or the other. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Montag, 28. April 2008 12:22 > To: Stephen Davies > Cc: rxtx at qbang.org; Oberhuber, Martin; Trent Jarvi > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > I don't think there would need to be any architectural > changes. A couple > ifdefs and minor changes in the current code should be enough. > > Proposal: > > FHS/UUCP locks: > continue to respect them, try to create them but do not error if > the IOCTL is supported. (But does the IOCTL being defined mean > it will work?) > Enumeration: > Do not assert the IOCTL while opening. > Serial.open: > assert the IOCTL after open. Continue to use locks as described > above after asserting the IOCTL. If the IOCTL is defined but > not working, handle it here. Failure cases include the IOCTL > is not supported and the port is already locked. > > On Mon, 28 Apr 2008, Stephen Davies wrote: > > > Has anybody done any design work on this? > > The first thing that springs to mind is that we still need > to check for lock > > files because other apps tend to use that approach even if > we go to ioctl. > > > > Cheers, > > Stephen Davies > > > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > >> Thanks Trent. > >> > >> Problem is only that I'm really not at all > >> Familiar with the C part of RXTX. If there > >> Were anything I could do in Java for this, > >> It would be easier for me.... > >> > >> ... Are there any C experts here on the list > >> Who'd like to look at ioctl port locking > >> For linux? > >> > >> Thanks, > >> -- > >> Martin Oberhuber, Senior Member of Technical Staff, Wind River > >> Target Management Project Lead, DSDP PMC Member > >> http://www.eclipse.org/dsdp/tm > >> > >>> -----Original Message----- > >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] > >>> Sent: Donnerstag, 24. April 2008 04:32 > >>> To: Oberhuber, Martin > >>> Cc: rxtx at qbang.org > >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? > >>> > >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > >>>> Dear RXTX community, > >>>> > >>>> I'm wondering what the status is with RXTX locking > >>>> serial ports on Linux? > >>>> > >>>> My understanding is that the mechanism used in > >>>> 2.1-7r2 (lockfiles) is not really state of the art, and > >>>> has lots of problems (e.g. missing permissions). > >>>> > >>>> There was an idea to migrate towards a Kernel > >>>> syscall based solution for port locking. > >>>> > >>>> What's the status here? > >>> > >>> Hi Martin, > >>> > >>> I'm in favor of deprecating the current FHS locking mechanism > >>> in favor of > >>> an IOCTL when available. I think it will be available on all the > >>> platforms but do not know for sure. > >>> > >>> The status is unchanged. I've had very few free cycles for > >>> such things. > >>> Feel free to take a stab at it if you have some time. I > >>> believe the IOCTL > >>> is used in the Mac OS X code already. > >>> > >>> I don't see any real backwards compatability issues and the > >>> IOCTL should > >>> just work. > >>> > >>> -- > >>> Trent Jarvi > >>> tjarvi at qbang.org > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > From Steffen.DETTMER at ingenico.com Tue Apr 29 13:34:44 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 29 Apr 2008 21:34:44 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Message-ID: <20080429193444.GU2928@elberon.bln.de.ingenico.com> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > The biggest problem that I have seen with lockfiles on Linux > At least is, that it seems there is no standard with respect > To the folder in which they should be created. Also, many > Distributions seem to set up file system permissions in such > A way that writing to the lockfile folder is not allowed for > The normal user -- that's why we stopped using lockfiles > In our commercial product. It seems it depends on the expectations. I consider it as a feature that by default a linux user cannot access serial ports. Maybe root connected a modem (can produce phone bills) or even some serial card reader, maybe with the web servers key pair. I would expect that by default a user cannot open the serial port because of insufficient permissions on the device file. I would expect this on other unices as well (but I don't know it). For windows I think it should be similar but not impacting so much in practice, because often windows users work with big permissions on a somewhat high priviledge level or even Administrator. > If we are to still respect lockfiles, we first need to > Understand where we are expected to look for them. Does > Anybody have any insight what variants of lockfile folder > Schema exist out there in the wild? Some apps like minicom > Seem to even allow users to manually specify a lockfile > Folder of their choice. At least my (ancient) minicom does not allow the user to change this option, it is displayed but read-only, but root is allowed to change it. > Because of the difficulty finding the right lockfile folder, > And because of the inherent risk of thinking that something > Might be locked while it actually isn't, I'd suggest that > RXTX should have a "soft-off" feature that allows disabling > ALL Lockfile checks at runtime without recompiling the native > Sharedlibs. sounds very reasonable, yes... and as admin I would not wish that users could skip such locking because they do things wrong by default ;) (in the end I guess that is related to the dilemma, that hotplug/user-owned-periphery and multi-user systems simply conflict) > Trent - I like your strategy outline, but I think that it > Needs to be configurable by the client such that users and/or > Customer Support can disable lockfiles / disable ioctl in > Case they detect that they are runing on an OS / Kernal that > Does not support one or the other. Yes, this would be good I guess... Applications could offer configuration options to control that, maybe similarily as minicom. BTW, man minicom tells: *B - Lock file location On most systems This should be /usr/spool/uucp. Linux systems use /var/lock. If this directory does not exist, minicom will not attempt to use lockfiles. The statement `Linux systems use /var/lock' is interesting, does anyone know the source of this convention? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Tue Apr 29 16:11:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Apr 2008 16:11:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? These details are outlined in the Filesystem Hierarchy Standard (FHS). http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLOCKLOCKFILES -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Tue Apr 29 18:58:09 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Wed, 30 Apr 2008 10:28:09 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: <200804301028.09307.scldad@sdc.com.au> I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is the same. Any ideas as to how to handle this? Stephen On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: > * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > > The biggest problem that I have seen with lockfiles on Linux > > At least is, that it seems there is no standard with respect > > To the folder in which they should be created. Also, many > > Distributions seem to set up file system permissions in such > > A way that writing to the lockfile folder is not allowed for > > The normal user -- that's why we stopped using lockfiles > > In our commercial product. > > It seems it depends on the expectations. I consider it as a > feature that by default a linux user cannot access serial ports. > Maybe root connected a modem (can produce phone bills) or even > some serial card reader, maybe with the web servers key pair. > > I would expect that by default a user cannot open the serial port > because of insufficient permissions on the device file. I would > expect this on other unices as well (but I don't know it). > > For windows I think it should be similar but not impacting so > much in practice, because often windows users work with big > permissions on a somewhat high priviledge level or even > Administrator. > > > If we are to still respect lockfiles, we first need to > > Understand where we are expected to look for them. Does > > Anybody have any insight what variants of lockfile folder > > Schema exist out there in the wild? Some apps like minicom > > Seem to even allow users to manually specify a lockfile > > Folder of their choice. > > At least my (ancient) minicom does not allow the user to change > this option, it is displayed but read-only, but root is allowed > to change it. > > > Because of the difficulty finding the right lockfile folder, > > And because of the inherent risk of thinking that something > > Might be locked while it actually isn't, I'd suggest that > > RXTX should have a "soft-off" feature that allows disabling > > ALL Lockfile checks at runtime without recompiling the native > > Sharedlibs. > > sounds very reasonable, yes... > and as admin I would not wish that users could skip such > locking because they do things wrong by default ;) > > (in the end I guess that is related to the dilemma, that > hotplug/user-owned-periphery and multi-user systems simply > conflict) > > > Trent - I like your strategy outline, but I think that it > > Needs to be configurable by the client such that users and/or > > Customer Support can disable lockfiles / disable ioctl in > > Case they detect that they are runing on an OS / Kernal that > > Does not support one or the other. > > Yes, this would be good I guess... Applications could offer > configuration options to control that, maybe similarily as > minicom. > > BTW, man minicom tells: > > *B - Lock file location > On most systems This should be /usr/spool/uucp. > Linux systems use /var/lock. If this directory > does not exist, minicom will not attempt to use > lockfiles. > > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure > and expedient electronic transaction acceptance. Ingenico products leverage > proven technology, established standards and unparalleled ergonomics to > provide optimal reliability, versatility and usability. This comprehensive > range of products is complemented by a global array of services and > partnerships, enabling businesses in a number of vertical sectors to accept > transactions anywhere their business takes them. www.ingenico.com This > message may contain confidential and/or privileged information. If you are > not the addressee or authorized to receive this for the addressee, you must > not use, copy, disclose or take any action based on this message or any > information herein. If you have received this message in error, please > advise the sender immediately by reply e-mail and delete this message. > Thank you for your cooperation. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Wed Apr 30 19:30:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 30 Apr 2008 19:30:51 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804301028.09307.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> <200804301028.09307.scldad@sdc.com.au> Message-ID: Hi Stephen, I suspect ioctl/TIOCEXCL open/O_EXCL would do the job. Mac uses TIOCEXCL and it is POSIX. We use O_EXCL for lockfiles on Linux already. On Wed, 30 Apr 2008, Stephen Davies wrote: > I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is > the same. > > Any ideas as to how to handle this? > > Stephen > > > On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: >> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: >>> The biggest problem that I have seen with lockfiles on Linux >>> At least is, that it seems there is no standard with respect >>> To the folder in which they should be created. Also, many >>> Distributions seem to set up file system permissions in such >>> A way that writing to the lockfile folder is not allowed for >>> The normal user -- that's why we stopped using lockfiles >>> In our commercial product. >> >> It seems it depends on the expectations. I consider it as a >> feature that by default a linux user cannot access serial ports. >> Maybe root connected a modem (can produce phone bills) or even >> some serial card reader, maybe with the web servers key pair. >> >> I would expect that by default a user cannot open the serial port >> because of insufficient permissions on the device file. I would >> expect this on other unices as well (but I don't know it). >> >> For windows I think it should be similar but not impacting so >> much in practice, because often windows users work with big >> permissions on a somewhat high priviledge level or even >> Administrator. >> >>> If we are to still respect lockfiles, we first need to >>> Understand where we are expected to look for them. Does >>> Anybody have any insight what variants of lockfile folder >>> Schema exist out there in the wild? Some apps like minicom >>> Seem to even allow users to manually specify a lockfile >>> Folder of their choice. >> >> At least my (ancient) minicom does not allow the user to change >> this option, it is displayed but read-only, but root is allowed >> to change it. >> >>> Because of the difficulty finding the right lockfile folder, >>> And because of the inherent risk of thinking that something >>> Might be locked while it actually isn't, I'd suggest that >>> RXTX should have a "soft-off" feature that allows disabling >>> ALL Lockfile checks at runtime without recompiling the native >>> Sharedlibs. >> >> sounds very reasonable, yes... >> and as admin I would not wish that users could skip such >> locking because they do things wrong by default ;) >> >> (in the end I guess that is related to the dilemma, that >> hotplug/user-owned-periphery and multi-user systems simply >> conflict) >> >>> Trent - I like your strategy outline, but I think that it >>> Needs to be configurable by the client such that users and/or >>> Customer Support can disable lockfiles / disable ioctl in >>> Case they detect that they are runing on an OS / Kernal that >>> Does not support one or the other. >> >> Yes, this would be good I guess... Applications could offer >> configuration options to control that, maybe similarily as >> minicom. >> >> BTW, man minicom tells: >> >> *B - Lock file location >> On most systems This should be /usr/spool/uucp. >> Linux systems use /var/lock. If this directory >> does not exist, minicom will not attempt to use >> lockfiles. >> >> The statement `Linux systems use /var/lock' is interesting, does >> anyone know the source of this convention? >> >> oki, >> >> Steffen >> >> About Ingenico Throughout the world businesses rely on Ingenico for secure >> and expedient electronic transaction acceptance. Ingenico products leverage >> proven technology, established standards and unparalleled ergonomics to >> provide optimal reliability, versatility and usability. This comprehensive >> range of products is complemented by a global array of services and >> partnerships, enabling businesses in a number of vertical sectors to accept >> transactions anywhere their business takes them. www.ingenico.com This >> message may contain confidential and/or privileged information. If you are >> not the addressee or authorized to receive this for the addressee, you must >> not use, copy, disclose or take any action based on this message or any >> information herein. If you have received this message in error, please >> advise the sender immediately by reply e-mail and delete this message. >> Thank you for your cooperation. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0042.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0040.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0027.html From pboulton at pulsetracer.com Fri Apr 18 14:30:13 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Fri, 18 Apr 2008 13:30:13 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site Message-ID: <480904D5.1060307@pulsetracer.com> Hello, gentle serial porters. I have downloaded the zipped up binaries for use on Windows without Sun's CommAPI, but don't seem able to extract anything from the download. Go to main page, http://www.rxtx.org/ Click on Downloads I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) And I save it to disk. If I try and extract the files with WinZip, Winzip thinks the archive is corrupt. If I try using Windows Explorer, I am able to extract it into a single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than the original .zip. Any help would be much appreciated. Sincerely, Philip Boulton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080418/97d89793/attachment-0025.html From tjarvi at qbang.org Fri Apr 18 19:07:00 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 18 Apr 2008 19:07:00 -0600 (MDT) Subject: [Rxtx] Difficulty opening zip file at rxtx site In-Reply-To: <480904D5.1060307@pulsetracer.com> References: <480904D5.1060307@pulsetracer.com> Message-ID: On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org From pboulton at pulsetracer.com Sat Apr 19 12:46:26 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Sat, 19 Apr 2008 11:46:26 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site References: <480904D5.1060307@pulsetracer.com> Message-ID: <53DB7576450695419E09299104043761A78533@ZTGSERVER.ztg.local> I have been able to get my hands on the binaries, by going to the ftp directory /pub/rxtx at ftp.qbang.org,, and ftping the file rxtx-2.1-7-bins-r2.zip . This opens happily with Winzip, and extracts as the set of files that you describe below. I only experience the ill-formed archive problem by clicking the link on the rxtx.org Downloads page (http://rxtx.qbang.org/pub/rxtx/ rxtx-2.1-7-bins-r2.zip ). Not sure what to make of that. Philip Boulton ________________________________ From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Fri 4/18/2008 6:07 PM To: Philip Boulton Cc: rxtx at qbang.org Subject: Re: [Rxtx] Difficulty opening zip file at rxtx site On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080419/147923bb/attachment-0024.html From jlar310 at gmail.com Sat Apr 19 19:11:55 2008 From: jlar310 at gmail.com (Jeff Larsen) Date: Sat, 19 Apr 2008 20:11:55 -0500 Subject: [Rxtx] Moxa serial over Ethernet driver Message-ID: Hi all, I've been using javax.comm for years to communicate with a legacy radio data system. We want to migrate the java side of the system to a VMware Server virtual machine. We've had great success using Moxa DE-303 and 5610 serial over Ethernet appliances and virtual machines for running hylafax. The OS (Linux in this case) uses a kernel driver to communicate with the Moxa via a virtual serial port such as /dev/ttyr00. I want to do the same thing with javax.comm or gnu.io to connect to a virtual serial port. However I'm hitting road blocks everywhere. javax.comm for Linux sees the virtual port, but there are transmission errors. Tried Solaris too, but the Solaris Moxa drivers don't play nice with javax.comm because the driver uses /dev/pts/n instead of /dev/term/x. Next I tried RXTX on Linux, but I'm getting NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX on Solaris. Has anyone used RXTX with serial over Ethernet devices? Any hints on how to make it work? I know that I'm not completely off track because javax.comm does work with Moxa on a Windows platform, but that's just not an option for production deployment. -- Jeff From tjarvi at qbang.org Sat Apr 19 21:08:41 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 19 Apr 2008 21:08:41 -0600 (MDT) Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: yOn Sat, 19 Apr 2008, Jeff Larsen wrote: > Hi all, > > I've been using javax.comm for years to communicate with a legacy > radio data system. We want to migrate the java side of the system to a > VMware Server virtual machine. We've had great success using Moxa > DE-303 and 5610 serial over Ethernet appliances and virtual machines > for running hylafax. The OS (Linux in this case) uses a kernel driver > to communicate with the Moxa via a virtual serial port such as > /dev/ttyr00. > > I want to do the same thing with javax.comm or gnu.io to connect to a > virtual serial port. However I'm hitting road blocks everywhere. > javax.comm for Linux sees the virtual port, but there are transmission > errors. Tried Solaris too, but the Solaris Moxa drivers don't play > nice with javax.comm because the driver uses /dev/pts/n instead of > /dev/term/x. Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris. > > Has anyone used RXTX with serial over Ethernet devices? Any hints on > how to make it work? > > I know that I'm not completely off track because javax.comm does work > with Moxa on a Windows platform, but that's just not an option for > production deployment. > > Moxa should work under linux. There may be minor issues depending upon how complete the kernel driver is but I think it will work. One of the minor issues is /dev/ttyr00 is not enumerated. There are several work arounds documented with the source code and on the wiki. The easiest solution for testing purposes is to make a symbolic link from /dev/ttyr00 to a port that is enumerated such as /dev/ttyS129. You can later alter the rxtx source or use properties to change the enumerated ports. -- Trent Jarvi tjarvi at qbang.org From d.tonhofer at m-plify.com Sun Apr 20 03:33:30 2008 From: d.tonhofer at m-plify.com (David Tonhofer (M-PLIFY S.A.)) Date: Sun, 20 Apr 2008 11:33:30 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: <480B0DEA.5010908@m-plify.com> Jeff Larsen wrote: > Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris It might be that the Java side of RXTX does not recognize that portname. Trying modifying src/RXTXCommDriver.java as described in this case: http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card From ajmas at sympatico.ca Sun Apr 20 16:37:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Apr 2008 18:37:59 -0400 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <480B0DEA.5010908@m-plify.com> References: <480B0DEA.5010908@m-plify.com> Message-ID: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > Jeff Larsen wrote: >> Next I tried RXTX on Linux, but I'm getting >> NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX >> on Solaris > It might be that the Java side of RXTX does not recognize that > portname. > Trying modifying src/RXTXCommDriver.java as described in this case: > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card I wonder whether it would be worth allowing custom port prefixes as a system parameter? For example: gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" Andre From Martin.Oberhuber at windriver.com Tue Apr 22 12:34:36 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 22 Apr 2008 20:34:36 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> References: <480B0DEA.5010908@m-plify.com> <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE6485848056CD6CE@ism-mail03.corp.ad.wrs.com> Sounds like a great idea... I'm wondering how the "variable part" after the Prefixes could be specified though? What about allowing Regular Expression character Classes in the existing System Property for specifying ports: System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyS[0-9],ttyS[ABC],ttyUSB[0-9a-z]"); The set of allowed patterns would of course need to Be restricted compared to REGEX, because it must be A syntax that supports iterating over it. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Montag, 21. April 2008 00:38 > To: rxtx at qbang.org and Users > Subject: Re: [Rxtx] Moxa serial over Ethernet driver > > > On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > > Jeff Larsen wrote: > >> Next I tried RXTX on Linux, but I'm getting > >> NoSuchPortException connecting to /dev/ttyr00. I have yet > to try RXTX > >> on Solaris > > It might be that the Java side of RXTX does not recognize that > > portname. > > Trying modifying src/RXTXCommDriver.java as described in this case: > > > > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_ > SST-4P.2FLP_multiport_card > > I wonder whether it would be worth allowing custom port > prefixes as a > system parameter? For > example: > > gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Loi.TRAN at weatherford.com Tue Apr 22 13:10:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Tue, 22 Apr 2008 14:10:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled Message-ID: Hi, I'm currently using the Java RXTX API to interface to a serial port. The serial port is connected to a bridge board that communicates with our communications system running at 1.875 Mbps which is linked to an embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no flow control). I send a command to the embedded board through the serial-bridge board which then is relayed to the embedded board. The command sent asks the embedded board to dump a binary image. Here's where I'm hitting some problems. I've successfully done this is an integrated serial port from the laptop. The binary file that comes back is consistent on every attempt. When I use the application I've written to do the same thing with a USB-to-serial adapter, the image I get back is not the same as the image I receive through the USB-to-serial adapter is not consistent at all. A final thing is that when I use a terminal program to dump the binary image with the USB-serial adapter, the image is correct. Every time! What is the terminal program doing that's not being done in my application? My application is quite simple. Has anyone observed this behavior before? If you have, I'd like to know how you've gotten around this problem. Thanks, LT =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From tjarvi at qbang.org Tue Apr 22 21:11:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 22 Apr 2008 21:11:10 -0600 (MDT) Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org From Loi.TRAN at weatherford.com Wed Apr 23 08:35:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Wed, 23 Apr 2008 09:35:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: Thanks for all the responses. I finally tried something that worked consistently. I updated my Prolific driver and repeated my tests. It worked. If you're using the Prolific type USB-serial adapters, do no use the Prolific version 2.0.2.1 driver on Windows. Update it to the latest 2.0.2.8 version. Again, thanks for all the responses. LT -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Tuesday, April 22, 2008 10:11 PM To: TRAN, Loi X. Cc: rxtx at qbang.org Subject: Re: [Rxtx] Prolific USB - RXTX data mangled On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From Martin.Oberhuber at windriver.com Wed Apr 23 18:54:26 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 02:54:26 +0200 Subject: [Rxtx] RXTX port locking on Linux status? Message-ID: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Dear RXTX community, I'm wondering what the status is with RXTX locking serial ports on Linux? My understanding is that the mechanism used in 2.1-7r2 (lockfiles) is not really state of the art, and has lots of problems (e.g. missing permissions). There was an idea to migrate towards a Kernel syscall based solution for port locking. What's the status here? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/9878db9f/attachment-0020.html From tjarvi at qbang.org Wed Apr 23 20:32:24 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Apr 2008 20:32:24 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > Dear RXTX community, > > I'm wondering what the status is with RXTX locking > serial ports on Linux? > > My understanding is that the mechanism used in > 2.1-7r2 (lockfiles) is not really state of the art, and > has lots of problems (e.g. missing permissions). > > There was an idea to migrate towards a Kernel > syscall based solution for port locking. > > What's the status here? > Hi Martin, I'm in favor of deprecating the current FHS locking mechanism in favor of an IOCTL when available. I think it will be available on all the platforms but do not know for sure. The status is unchanged. I've had very few free cycles for such things. Feel free to take a stab at it if you have some time. I believe the IOCTL is used in the Mac OS X code already. I don't see any real backwards compatability issues and the IOCTL should just work. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Apr 24 06:14:06 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 14:14:06 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Thanks Trent. Problem is only that I'm really not at all Familiar with the C part of RXTX. If there Were anything I could do in Java for this, It would be easier for me.... ... Are there any C experts here on the list Who'd like to look at ioctl port locking For linux? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Donnerstag, 24. April 2008 04:32 > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > I'm wondering what the status is with RXTX locking > > serial ports on Linux? > > > > My understanding is that the mechanism used in > > 2.1-7r2 (lockfiles) is not really state of the art, and > > has lots of problems (e.g. missing permissions). > > > > There was an idea to migrate towards a Kernel > > syscall based solution for port locking. > > > > What's the status here? > > > > Hi Martin, > > I'm in favor of deprecating the current FHS locking mechanism > in favor of > an IOCTL when available. I think it will be available on all the > platforms but do not know for sure. > > The status is unchanged. I've had very few free cycles for > such things. > Feel free to take a stab at it if you have some time. I > believe the IOCTL > is used in the Mac OS X code already. > > I don't see any real backwards compatability issues and the > IOCTL should > just work. > > -- > Trent Jarvi > tjarvi at qbang.org > From sspies at sloc.de Thu Apr 24 07:15:36 2008 From: sspies at sloc.de (Sebastian Spies) Date: Thu, 24 Apr 2008 15:15:36 +0200 (CEST) Subject: [Rxtx] rxtx on gumstix: Interrupted system call In-Reply-To: <47FB7B20.7080504@sloc.de> References: <47FB7B20.7080504@sloc.de> Message-ID: <55445.130.83.139.205.1209042936.squirrel@ssl.sloc.de> Dear list, while porting rxtx to the gumstix, I found out, that select used in readArray in SerialImp.c might not work as expected. Maybe, because of missing TIOCSERGETLSR-support? select is often interrupted, so i wrote the following quick'n'dirty hack to make it work on gumstix: diff -Nur rxtx-2.1-7r2/src/SerialImp.c rxtx-2.1-7r2/src/SerialImp.c --- rxtx-2.1-7r2/src/SerialImp.c 2006-01-29 23:19:04.000000000 +0100 +++ rxtx-2.1-7r2-patched/src/SerialImp.c 2008-04-24 14:30:17.000000000 +0200 @@ -3380,7 +3381,7 @@ JNIEXPORT jint JNICALL RXTXPort(readArray)( JNIEnv *env, jobject jobj, jbyteArray jbarray, jint offset, jint length ) { - int bytes; + int bytes = 0; jbyte *body; /* char msg[80]; */ int fd = get_java_var( env, jobj, "fd", "I" ); @@ -3397,9 +3398,18 @@ "readArray", "Invalid length" ); return -1; } - body = (*env)->GetByteArrayElements( env, jbarray, 0 ); - bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ - (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + while(1 > bytes) + { + body = (*env)->GetByteArrayElements( env, jbarray, 0 ); + bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ + (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + // quick'n'dirty - SSP + report (" trying again... \n"); + errno = 0; + } + if( bytes < 0 ) { report( "RXTXPort:readArray bytes < 0" ); LEAVE( "RXTXPort:readArray" ); > Hey, > > I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use > RXTXPort$SerialInputStream.read(), then I get the following Exception. I > did not yet figure out which system call is interrupted as strace > produces loads of output. > > Any help would be very appreciated. Thanks in advance. > Sebastian > > > [java] java.io.IOException: Interrupted system call in readArray > [java] at gnu.io.RXTXPort.readArray(Native Method) > [java] at > gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) > [java] at > java.io.FilterInputStream.read(FilterInputStream.java:189) > [java] at > java.io.BufferedInputStream.refill(BufferedInputStream.java:371) > [java] at > java.io.BufferedInputStream.read(BufferedInputStream.java:229) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) > [java] at > com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) > > -- > Sebastian Spies > > mail: sspies at sloc.de > > > > From fire_baptized at hotmail.com Thu Apr 24 18:27:48 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Thu, 24 Apr 2008 20:27:48 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hello I am having a problem with the serial device connecting (software wise) to the serial port. However I have a test program and it seems to work just fine in that environment - and it doesnt use GUI. The error I am getting is : PortNotFoundException Now the way I have it setup in the GUI environment is that once the user pushes a JButton the program connects using this class: protected void establishConnection() { try { portId = CommPortIdentifier.getPortIdentifier("COM3"); System.out.println("Establishing connction....."); messages[0] = "\nEstablishing connction.....\n"; } catch ( NoSuchPortException noport) { System.out.println("Port not found: "+ noport); messages[0] = "Port not found: "+ noport+"\n"; } try { serialPort = (SerialPort) portId.open("serial", 50); System.out.println("Port has been found."); messages[1] = "Port has been found.\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[1] = "" +usedport; } try { serialPort = (SerialPort) portId.open("serial", 50); messages[2] = "Connecting to COM3 on port 50....\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; } try { serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); System.out.println("Esablishing the transfer rate settings for COM3."); messages[3] = "Esablishing the transfer rate settings for COM3.\n"; } catch (UnsupportedCommOperationException nosupcom) { System.out.println(nosupcom); System.out.println("The tranfer rate could not be esblished on COM3."); messages[3] = "The tranfer rate could not be esblished on COM3.\n"; } System.out.println(serialPort.getFlowControlMode()); messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; //sendDataOut(buffer[3],buffer[4]); } I need all the data in this method (and all the string values in this method) to be printed out on a JTextArea. I wont do me any good if not all the text is printed on a JTextArea in another class. So I have the text printing the JTextArea correctly, but everytime the JButton is activated - it gives me that error message. I did add a disconnect button that is supposed to call the serialPort.close(). _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/273fd4ec/attachment-0019.html From tjarvi at qbang.org Thu Apr 24 21:54:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Apr 2008 21:54:10 -0600 (MDT) Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > Hello I am having a problem with the serial device connecting (software > wise) to the serial port. However I have a test program and it seems to > work just fine in that environment - and it doesnt use GUI. The error I > am getting is : PortNotFoundException Now the way I have it setup in the > GUI environment is that once the user pushes a JButton the program > connects using this class: > > protected void establishConnection() { > try { > portId = CommPortIdentifier.getPortIdentifier("COM3"); > System.out.println("Establishing connction....."); > messages[0] = "\nEstablishing connction.....\n"; > } > catch ( NoSuchPortException noport) { > System.out.println("Port not found: "+ noport); > messages[0] = "Port not found: "+ noport+"\n"; > } > try { > serialPort = (SerialPort) portId.open("serial", 50); > System.out.println("Port has been found."); > messages[1] = "Port has been found.\n"; > } > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[1] = "" +usedport; > } ================================================================= > try { > serialPort = (SerialPort) portId.open("serial", 50); > messages[2] = "Connecting to COM3 on port 50....\n"; > } ================================================================== > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > } > try { > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > System.out.println("Esablishing the transfer rate settings for COM3."); > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > } > catch (UnsupportedCommOperationException nosupcom) { > System.out.println(nosupcom); > System.out.println("The tranfer rate could not be esblished on COM3."); > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > } > System.out.println(serialPort.getFlowControlMode()); > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > //sendDataOut(buffer[3],buffer[4]); > } > > I need all the data in this method (and all the string values in this > method) to be printed out on a JTextArea. I wont do me any good if not > all the text is printed on a JTextArea in another class. So I have the > text printing the JTextArea correctly, but everytime the JButton is > activated - it gives me that error message. I did add a disconnect > button that is supposed to call the serialPort.close(). > The open code used twice is going to throw an exception. It may be that you catch the exception above this code and print a confusing message? A common mistake is people will accidently run two copies of their program. The first instance of the program will open the port and prevent enumeration (finding the port) in the second instance of the program. As an example, you may be running your text based application which is preventing the GUI from seeing the port. Enumeration is done by trying to open the port. If the port is open, Enumeration fails. -- Trent Jarvi tjarvi at qbang.org From fire_baptized at hotmail.com Thu Apr 24 22:32:05 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 00:32:05 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Wow - thanks dude what a dumb thing for me to not catch..... now here is the current problem - right now I am trying to output data again one is with the test program - and it seems that serialPort.setRTS(true); is throwing an exceptions there - now if I show this code please bare in mind that I am only testing - the code is kinda sloppy in my mind - but if I can figure out why calling this function is throwing an exception then maybe I can figure out why my GUI application is getting the same null pointer exceptions when try to send out the data stream. FYI Trent this email is not directed towards you - anyone can jump in on this public static void main(String args[]) { byte[] b = new byte[64]; int keyinput = 0 ; byte x = 0; byte y = 0; PortTesting1 testports = new PortTesting1(); try { joyskoro = Joystick.createInstance(); } catch (IOException ioexc) { System.out.println("There is an input/output problem: " + ioexc); } while (true) { joyskoro.poll(); b[0] = ((byte) -(10 * joyskoro.getY())); b[1] = ((byte) (10 * joyskoro.getX())); System.out.println("The 3rd byte is: " +b[0]); System.out.println("The 4rd byte is: " +b[1]); serialPort.setRTS(true); // HERE IS WHERE THE PROBLEM IS !!!!!!! ON THIS LINE but if I dont have it active in my program the Bluetooth device (that is System.out.println("Ready to send :-) !"); //connected to the serial port does not send out data!!!!! if (joyskoro.isButtonDown(joyskoro.BUTTON10)) { System.out.println("Connection terminated."); serialPort.close(); break; } if (joyskoro.isButtonDown(joyskoro.BUTTON2)) { boolean flag = true; //reading from key input from the keyboard System.out.println("Please input a command: "); while (flag) { try { keyinput = System.in.read(); } catch (IOException ioexc) {/*there is no need to put * anything here */ } if((char)keyinput=='w') { pushIt((byte)85); } if((char)keyinput=='s') { pushIt((byte)84); } if((char)keyinput=='a') { pushIt((byte)83); } if((char)keyinput=='d') { pushIt((byte)82); } if((char)keyinput=='q') { pushIt((byte)89); } if((char)keyinput=='\t') { //this stop reading input from the keyboard flag = false; } } and help anyways here is the block of code that throwing an exception for the test program: > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/5c8f7d68/attachment-0019.html From fire_baptized at hotmail.com Fri Apr 25 07:59:53 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 09:59:53 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Are there any examples of how to push out data? As in using input and output streams - if I can compare code maybe I can see where this is causing a problem. I have a byte array that I am pushing out data. I keep getting null pointer exceptions every where I turn. > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/22228ab6/attachment-0018.html From ajmas at sympatico.ca Sat Apr 26 07:37:09 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 26 Apr 2008 09:37:09 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hi, On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote: > > Are there any examples of how to push out data? As in using input > and output streams - if I can compare code maybe I can see where > this is causing a problem. I have a byte array that I am pushing > out data. I keep getting null pointer exceptions every where I turn. > There are some examples here that might be of help: http://rxtx.qbang.org/wiki/index.php/Examples Andre From fire_baptized at hotmail.com Sat Apr 26 20:13:54 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Sat, 26 Apr 2008 22:13:54 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: looked at those....yep didnt help - I need to push out data with GUI and not get a null pointer exception everytime I try. > CC: rxtx at qbang.org> From: ajmas at sympatico.ca> To: fire_baptized at hotmail.com> Subject: Re: [Rxtx] Serial Problems with Gui.....> Date: Sat, 26 Apr 2008 09:37:09 -0400> > Hi,> > > On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote:> >> > Are there any examples of how to push out data? As in using input > > and output streams - if I can compare code maybe I can see where > > this is causing a problem. I have a byte array that I am pushing > > out data. I keep getting null pointer exceptions every where I turn.> >> > There are some examples here that might be of help:> > http://rxtx.qbang.org/wiki/index.php/Examples> > Andre _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080426/09f95b41/attachment-0017.html From michael.erskine at ketech.com Mon Apr 28 02:47:22 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 28 Apr 2008 09:47:22 +0100 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D426EF3CBBC5@no-sv-03.ketech.local> Jesrael D. Summerhill wrote: > looked at those....yep didnt help - I need to push out data with GUI and > not get a null pointer exception everytime I try. So it seems pretty obvious that your code needs to check for nulls wherever one may occur and report what's happening. Alternatively, catch the npe and display the stack trace. Then you can fix your code so it doesn't try to work with something that ain't there. Regards, Michael Erskine. From scldad at sdc.com.au Mon Apr 28 03:58:34 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Mon, 28 Apr 2008 19:28:34 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Message-ID: <200804281928.34454.scldad@sdc.com.au> Has anybody done any design work on this? The first thing that springs to mind is that we still need to check for lock files because other apps tend to use that approach even if we go to ioctl. Cheers, Stephen Davies On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > Thanks Trent. > > Problem is only that I'm really not at all > Familiar with the C part of RXTX. If there > Were anything I could do in Java for this, > It would be easier for me.... > > ... Are there any C experts here on the list > Who'd like to look at ioctl port locking > For linux? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > -----Original Message----- > > From: Trent Jarvi [mailto:tjarvi at qbang.org] > > Sent: Donnerstag, 24. April 2008 04:32 > > To: Oberhuber, Martin > > Cc: rxtx at qbang.org > > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > > > I'm wondering what the status is with RXTX locking > > > serial ports on Linux? > > > > > > My understanding is that the mechanism used in > > > 2.1-7r2 (lockfiles) is not really state of the art, and > > > has lots of problems (e.g. missing permissions). > > > > > > There was an idea to migrate towards a Kernel > > > syscall based solution for port locking. > > > > > > What's the status here? > > > > Hi Martin, > > > > I'm in favor of deprecating the current FHS locking mechanism > > in favor of > > an IOCTL when available. I think it will be available on all the > > platforms but do not know for sure. > > > > The status is unchanged. I've had very few free cycles for > > such things. > > Feel free to take a stab at it if you have some time. I > > believe the IOCTL > > is used in the Mac OS X code already. > > > > I don't see any real backwards compatability issues and the > > IOCTL should > > just work. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Mon Apr 28 04:21:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 28 Apr 2008 04:21:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804281928.34454.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: I don't think there would need to be any architectural changes. A couple ifdefs and minor changes in the current code should be enough. Proposal: FHS/UUCP locks: continue to respect them, try to create them but do not error if the IOCTL is supported. (But does the IOCTL being defined mean it will work?) Enumeration: Do not assert the IOCTL while opening. Serial.open: assert the IOCTL after open. Continue to use locks as described above after asserting the IOCTL. If the IOCTL is defined but not working, handle it here. Failure cases include the IOCTL is not supported and the port is already locked. On Mon, 28 Apr 2008, Stephen Davies wrote: > Has anybody done any design work on this? > The first thing that springs to mind is that we still need to check for lock > files because other apps tend to use that approach even if we go to ioctl. > > Cheers, > Stephen Davies > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: >> Thanks Trent. >> >> Problem is only that I'm really not at all >> Familiar with the C part of RXTX. If there >> Were anything I could do in Java for this, >> It would be easier for me.... >> >> ... Are there any C experts here on the list >> Who'd like to look at ioctl port locking >> For linux? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >>> -----Original Message----- >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] >>> Sent: Donnerstag, 24. April 2008 04:32 >>> To: Oberhuber, Martin >>> Cc: rxtx at qbang.org >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? >>> >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: >>>> Dear RXTX community, >>>> >>>> I'm wondering what the status is with RXTX locking >>>> serial ports on Linux? >>>> >>>> My understanding is that the mechanism used in >>>> 2.1-7r2 (lockfiles) is not really state of the art, and >>>> has lots of problems (e.g. missing permissions). >>>> >>>> There was an idea to migrate towards a Kernel >>>> syscall based solution for port locking. >>>> >>>> What's the status here? >>> >>> Hi Martin, >>> >>> I'm in favor of deprecating the current FHS locking mechanism >>> in favor of >>> an IOCTL when available. I think it will be available on all the >>> platforms but do not know for sure. >>> >>> The status is unchanged. I've had very few free cycles for >>> such things. >>> Feel free to take a stab at it if you have some time. I >>> believe the IOCTL >>> is used in the Mac OS X code already. >>> >>> I don't see any real backwards compatability issues and the >>> IOCTL should >>> just work. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Tue Apr 29 12:04:04 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Apr 2008 20:04:04 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Hi all, The biggest problem that I have seen with lockfiles on Linux At least is, that it seems there is no standard with respect To the folder in which they should be created. Also, many Distributions seem to set up file system permissions in such A way that writing to the lockfile folder is not allowed for The normal user -- that's why we stopped using lockfiles In our commercial product. If we are to still respect lockfiles, we first need to Understand where we are expected to look for them. Does Anybody have any insight what variants of lockfile folder Schema exist out there in the wild? Some apps like minicom Seem to even allow users to manually specify a lockfile Folder of their choice. Because of the difficulty finding the right lockfile folder, And because of the inherent risk of thinking that something Might be locked while it actually isn't, I'd suggest that RXTX should have a "soft-off" feature that allows disabling ALL Lockfile checks at runtime without recompiling the native Sharedlibs. Trent - I like your strategy outline, but I think that it Needs to be configurable by the client such that users and/or Customer Support can disable lockfiles / disable ioctl in Case they detect that they are runing on an OS / Kernal that Does not support one or the other. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Montag, 28. April 2008 12:22 > To: Stephen Davies > Cc: rxtx at qbang.org; Oberhuber, Martin; Trent Jarvi > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > I don't think there would need to be any architectural > changes. A couple > ifdefs and minor changes in the current code should be enough. > > Proposal: > > FHS/UUCP locks: > continue to respect them, try to create them but do not error if > the IOCTL is supported. (But does the IOCTL being defined mean > it will work?) > Enumeration: > Do not assert the IOCTL while opening. > Serial.open: > assert the IOCTL after open. Continue to use locks as described > above after asserting the IOCTL. If the IOCTL is defined but > not working, handle it here. Failure cases include the IOCTL > is not supported and the port is already locked. > > On Mon, 28 Apr 2008, Stephen Davies wrote: > > > Has anybody done any design work on this? > > The first thing that springs to mind is that we still need > to check for lock > > files because other apps tend to use that approach even if > we go to ioctl. > > > > Cheers, > > Stephen Davies > > > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > >> Thanks Trent. > >> > >> Problem is only that I'm really not at all > >> Familiar with the C part of RXTX. If there > >> Were anything I could do in Java for this, > >> It would be easier for me.... > >> > >> ... Are there any C experts here on the list > >> Who'd like to look at ioctl port locking > >> For linux? > >> > >> Thanks, > >> -- > >> Martin Oberhuber, Senior Member of Technical Staff, Wind River > >> Target Management Project Lead, DSDP PMC Member > >> http://www.eclipse.org/dsdp/tm > >> > >>> -----Original Message----- > >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] > >>> Sent: Donnerstag, 24. April 2008 04:32 > >>> To: Oberhuber, Martin > >>> Cc: rxtx at qbang.org > >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? > >>> > >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > >>>> Dear RXTX community, > >>>> > >>>> I'm wondering what the status is with RXTX locking > >>>> serial ports on Linux? > >>>> > >>>> My understanding is that the mechanism used in > >>>> 2.1-7r2 (lockfiles) is not really state of the art, and > >>>> has lots of problems (e.g. missing permissions). > >>>> > >>>> There was an idea to migrate towards a Kernel > >>>> syscall based solution for port locking. > >>>> > >>>> What's the status here? > >>> > >>> Hi Martin, > >>> > >>> I'm in favor of deprecating the current FHS locking mechanism > >>> in favor of > >>> an IOCTL when available. I think it will be available on all the > >>> platforms but do not know for sure. > >>> > >>> The status is unchanged. I've had very few free cycles for > >>> such things. > >>> Feel free to take a stab at it if you have some time. I > >>> believe the IOCTL > >>> is used in the Mac OS X code already. > >>> > >>> I don't see any real backwards compatability issues and the > >>> IOCTL should > >>> just work. > >>> > >>> -- > >>> Trent Jarvi > >>> tjarvi at qbang.org > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > From Steffen.DETTMER at ingenico.com Tue Apr 29 13:34:44 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 29 Apr 2008 21:34:44 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Message-ID: <20080429193444.GU2928@elberon.bln.de.ingenico.com> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > The biggest problem that I have seen with lockfiles on Linux > At least is, that it seems there is no standard with respect > To the folder in which they should be created. Also, many > Distributions seem to set up file system permissions in such > A way that writing to the lockfile folder is not allowed for > The normal user -- that's why we stopped using lockfiles > In our commercial product. It seems it depends on the expectations. I consider it as a feature that by default a linux user cannot access serial ports. Maybe root connected a modem (can produce phone bills) or even some serial card reader, maybe with the web servers key pair. I would expect that by default a user cannot open the serial port because of insufficient permissions on the device file. I would expect this on other unices as well (but I don't know it). For windows I think it should be similar but not impacting so much in practice, because often windows users work with big permissions on a somewhat high priviledge level or even Administrator. > If we are to still respect lockfiles, we first need to > Understand where we are expected to look for them. Does > Anybody have any insight what variants of lockfile folder > Schema exist out there in the wild? Some apps like minicom > Seem to even allow users to manually specify a lockfile > Folder of their choice. At least my (ancient) minicom does not allow the user to change this option, it is displayed but read-only, but root is allowed to change it. > Because of the difficulty finding the right lockfile folder, > And because of the inherent risk of thinking that something > Might be locked while it actually isn't, I'd suggest that > RXTX should have a "soft-off" feature that allows disabling > ALL Lockfile checks at runtime without recompiling the native > Sharedlibs. sounds very reasonable, yes... and as admin I would not wish that users could skip such locking because they do things wrong by default ;) (in the end I guess that is related to the dilemma, that hotplug/user-owned-periphery and multi-user systems simply conflict) > Trent - I like your strategy outline, but I think that it > Needs to be configurable by the client such that users and/or > Customer Support can disable lockfiles / disable ioctl in > Case they detect that they are runing on an OS / Kernal that > Does not support one or the other. Yes, this would be good I guess... Applications could offer configuration options to control that, maybe similarily as minicom. BTW, man minicom tells: *B - Lock file location On most systems This should be /usr/spool/uucp. Linux systems use /var/lock. If this directory does not exist, minicom will not attempt to use lockfiles. The statement `Linux systems use /var/lock' is interesting, does anyone know the source of this convention? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Tue Apr 29 16:11:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Apr 2008 16:11:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? These details are outlined in the Filesystem Hierarchy Standard (FHS). http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLOCKLOCKFILES -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Tue Apr 29 18:58:09 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Wed, 30 Apr 2008 10:28:09 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: <200804301028.09307.scldad@sdc.com.au> I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is the same. Any ideas as to how to handle this? Stephen On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: > * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > > The biggest problem that I have seen with lockfiles on Linux > > At least is, that it seems there is no standard with respect > > To the folder in which they should be created. Also, many > > Distributions seem to set up file system permissions in such > > A way that writing to the lockfile folder is not allowed for > > The normal user -- that's why we stopped using lockfiles > > In our commercial product. > > It seems it depends on the expectations. I consider it as a > feature that by default a linux user cannot access serial ports. > Maybe root connected a modem (can produce phone bills) or even > some serial card reader, maybe with the web servers key pair. > > I would expect that by default a user cannot open the serial port > because of insufficient permissions on the device file. I would > expect this on other unices as well (but I don't know it). > > For windows I think it should be similar but not impacting so > much in practice, because often windows users work with big > permissions on a somewhat high priviledge level or even > Administrator. > > > If we are to still respect lockfiles, we first need to > > Understand where we are expected to look for them. Does > > Anybody have any insight what variants of lockfile folder > > Schema exist out there in the wild? Some apps like minicom > > Seem to even allow users to manually specify a lockfile > > Folder of their choice. > > At least my (ancient) minicom does not allow the user to change > this option, it is displayed but read-only, but root is allowed > to change it. > > > Because of the difficulty finding the right lockfile folder, > > And because of the inherent risk of thinking that something > > Might be locked while it actually isn't, I'd suggest that > > RXTX should have a "soft-off" feature that allows disabling > > ALL Lockfile checks at runtime without recompiling the native > > Sharedlibs. > > sounds very reasonable, yes... > and as admin I would not wish that users could skip such > locking because they do things wrong by default ;) > > (in the end I guess that is related to the dilemma, that > hotplug/user-owned-periphery and multi-user systems simply > conflict) > > > Trent - I like your strategy outline, but I think that it > > Needs to be configurable by the client such that users and/or > > Customer Support can disable lockfiles / disable ioctl in > > Case they detect that they are runing on an OS / Kernal that > > Does not support one or the other. > > Yes, this would be good I guess... Applications could offer > configuration options to control that, maybe similarily as > minicom. > > BTW, man minicom tells: > > *B - Lock file location > On most systems This should be /usr/spool/uucp. > Linux systems use /var/lock. If this directory > does not exist, minicom will not attempt to use > lockfiles. > > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure > and expedient electronic transaction acceptance. Ingenico products leverage > proven technology, established standards and unparalleled ergonomics to > provide optimal reliability, versatility and usability. This comprehensive > range of products is complemented by a global array of services and > partnerships, enabling businesses in a number of vertical sectors to accept > transactions anywhere their business takes them. www.ingenico.com This > message may contain confidential and/or privileged information. If you are > not the addressee or authorized to receive this for the addressee, you must > not use, copy, disclose or take any action based on this message or any > information herein. If you have received this message in error, please > advise the sender immediately by reply e-mail and delete this message. > Thank you for your cooperation. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Wed Apr 30 19:30:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 30 Apr 2008 19:30:51 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804301028.09307.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> <200804301028.09307.scldad@sdc.com.au> Message-ID: Hi Stephen, I suspect ioctl/TIOCEXCL open/O_EXCL would do the job. Mac uses TIOCEXCL and it is POSIX. We use O_EXCL for lockfiles on Linux already. On Wed, 30 Apr 2008, Stephen Davies wrote: > I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is > the same. > > Any ideas as to how to handle this? > > Stephen > > > On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: >> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: >>> The biggest problem that I have seen with lockfiles on Linux >>> At least is, that it seems there is no standard with respect >>> To the folder in which they should be created. Also, many >>> Distributions seem to set up file system permissions in such >>> A way that writing to the lockfile folder is not allowed for >>> The normal user -- that's why we stopped using lockfiles >>> In our commercial product. >> >> It seems it depends on the expectations. I consider it as a >> feature that by default a linux user cannot access serial ports. >> Maybe root connected a modem (can produce phone bills) or even >> some serial card reader, maybe with the web servers key pair. >> >> I would expect that by default a user cannot open the serial port >> because of insufficient permissions on the device file. I would >> expect this on other unices as well (but I don't know it). >> >> For windows I think it should be similar but not impacting so >> much in practice, because often windows users work with big >> permissions on a somewhat high priviledge level or even >> Administrator. >> >>> If we are to still respect lockfiles, we first need to >>> Understand where we are expected to look for them. Does >>> Anybody have any insight what variants of lockfile folder >>> Schema exist out there in the wild? Some apps like minicom >>> Seem to even allow users to manually specify a lockfile >>> Folder of their choice. >> >> At least my (ancient) minicom does not allow the user to change >> this option, it is displayed but read-only, but root is allowed >> to change it. >> >>> Because of the difficulty finding the right lockfile folder, >>> And because of the inherent risk of thinking that something >>> Might be locked while it actually isn't, I'd suggest that >>> RXTX should have a "soft-off" feature that allows disabling >>> ALL Lockfile checks at runtime without recompiling the native >>> Sharedlibs. >> >> sounds very reasonable, yes... >> and as admin I would not wish that users could skip such >> locking because they do things wrong by default ;) >> >> (in the end I guess that is related to the dilemma, that >> hotplug/user-owned-periphery and multi-user systems simply >> conflict) >> >>> Trent - I like your strategy outline, but I think that it >>> Needs to be configurable by the client such that users and/or >>> Customer Support can disable lockfiles / disable ioctl in >>> Case they detect that they are runing on an OS / Kernal that >>> Does not support one or the other. >> >> Yes, this would be good I guess... Applications could offer >> configuration options to control that, maybe similarily as >> minicom. >> >> BTW, man minicom tells: >> >> *B - Lock file location >> On most systems This should be /usr/spool/uucp. >> Linux systems use /var/lock. If this directory >> does not exist, minicom will not attempt to use >> lockfiles. >> >> The statement `Linux systems use /var/lock' is interesting, does >> anyone know the source of this convention? >> >> oki, >> >> Steffen >> >> About Ingenico Throughout the world businesses rely on Ingenico for secure >> and expedient electronic transaction acceptance. Ingenico products leverage >> proven technology, established standards and unparalleled ergonomics to >> provide optimal reliability, versatility and usability. This comprehensive >> range of products is complemented by a global array of services and >> partnerships, enabling businesses in a number of vertical sectors to accept >> transactions anywhere their business takes them. www.ingenico.com This >> message may contain confidential and/or privileged information. If you are >> not the addressee or authorized to receive this for the addressee, you must >> not use, copy, disclose or take any action based on this message or any >> information herein. If you have received this message in error, please >> advise the sender immediately by reply e-mail and delete this message. >> Thank you for your cooperation. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0043.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0041.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0028.html From pboulton at pulsetracer.com Fri Apr 18 14:30:13 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Fri, 18 Apr 2008 13:30:13 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site Message-ID: <480904D5.1060307@pulsetracer.com> Hello, gentle serial porters. I have downloaded the zipped up binaries for use on Windows without Sun's CommAPI, but don't seem able to extract anything from the download. Go to main page, http://www.rxtx.org/ Click on Downloads I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) And I save it to disk. If I try and extract the files with WinZip, Winzip thinks the archive is corrupt. If I try using Windows Explorer, I am able to extract it into a single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than the original .zip. Any help would be much appreciated. Sincerely, Philip Boulton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080418/97d89793/attachment-0026.html From tjarvi at qbang.org Fri Apr 18 19:07:00 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 18 Apr 2008 19:07:00 -0600 (MDT) Subject: [Rxtx] Difficulty opening zip file at rxtx site In-Reply-To: <480904D5.1060307@pulsetracer.com> References: <480904D5.1060307@pulsetracer.com> Message-ID: On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org From pboulton at pulsetracer.com Sat Apr 19 12:46:26 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Sat, 19 Apr 2008 11:46:26 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site References: <480904D5.1060307@pulsetracer.com> Message-ID: <53DB7576450695419E09299104043761A78533@ZTGSERVER.ztg.local> I have been able to get my hands on the binaries, by going to the ftp directory /pub/rxtx at ftp.qbang.org,, and ftping the file rxtx-2.1-7-bins-r2.zip . This opens happily with Winzip, and extracts as the set of files that you describe below. I only experience the ill-formed archive problem by clicking the link on the rxtx.org Downloads page (http://rxtx.qbang.org/pub/rxtx/ rxtx-2.1-7-bins-r2.zip ). Not sure what to make of that. Philip Boulton ________________________________ From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Fri 4/18/2008 6:07 PM To: Philip Boulton Cc: rxtx at qbang.org Subject: Re: [Rxtx] Difficulty opening zip file at rxtx site On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080419/147923bb/attachment-0025.html From jlar310 at gmail.com Sat Apr 19 19:11:55 2008 From: jlar310 at gmail.com (Jeff Larsen) Date: Sat, 19 Apr 2008 20:11:55 -0500 Subject: [Rxtx] Moxa serial over Ethernet driver Message-ID: Hi all, I've been using javax.comm for years to communicate with a legacy radio data system. We want to migrate the java side of the system to a VMware Server virtual machine. We've had great success using Moxa DE-303 and 5610 serial over Ethernet appliances and virtual machines for running hylafax. The OS (Linux in this case) uses a kernel driver to communicate with the Moxa via a virtual serial port such as /dev/ttyr00. I want to do the same thing with javax.comm or gnu.io to connect to a virtual serial port. However I'm hitting road blocks everywhere. javax.comm for Linux sees the virtual port, but there are transmission errors. Tried Solaris too, but the Solaris Moxa drivers don't play nice with javax.comm because the driver uses /dev/pts/n instead of /dev/term/x. Next I tried RXTX on Linux, but I'm getting NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX on Solaris. Has anyone used RXTX with serial over Ethernet devices? Any hints on how to make it work? I know that I'm not completely off track because javax.comm does work with Moxa on a Windows platform, but that's just not an option for production deployment. -- Jeff From tjarvi at qbang.org Sat Apr 19 21:08:41 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 19 Apr 2008 21:08:41 -0600 (MDT) Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: yOn Sat, 19 Apr 2008, Jeff Larsen wrote: > Hi all, > > I've been using javax.comm for years to communicate with a legacy > radio data system. We want to migrate the java side of the system to a > VMware Server virtual machine. We've had great success using Moxa > DE-303 and 5610 serial over Ethernet appliances and virtual machines > for running hylafax. The OS (Linux in this case) uses a kernel driver > to communicate with the Moxa via a virtual serial port such as > /dev/ttyr00. > > I want to do the same thing with javax.comm or gnu.io to connect to a > virtual serial port. However I'm hitting road blocks everywhere. > javax.comm for Linux sees the virtual port, but there are transmission > errors. Tried Solaris too, but the Solaris Moxa drivers don't play > nice with javax.comm because the driver uses /dev/pts/n instead of > /dev/term/x. Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris. > > Has anyone used RXTX with serial over Ethernet devices? Any hints on > how to make it work? > > I know that I'm not completely off track because javax.comm does work > with Moxa on a Windows platform, but that's just not an option for > production deployment. > > Moxa should work under linux. There may be minor issues depending upon how complete the kernel driver is but I think it will work. One of the minor issues is /dev/ttyr00 is not enumerated. There are several work arounds documented with the source code and on the wiki. The easiest solution for testing purposes is to make a symbolic link from /dev/ttyr00 to a port that is enumerated such as /dev/ttyS129. You can later alter the rxtx source or use properties to change the enumerated ports. -- Trent Jarvi tjarvi at qbang.org From d.tonhofer at m-plify.com Sun Apr 20 03:33:30 2008 From: d.tonhofer at m-plify.com (David Tonhofer (M-PLIFY S.A.)) Date: Sun, 20 Apr 2008 11:33:30 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: <480B0DEA.5010908@m-plify.com> Jeff Larsen wrote: > Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris It might be that the Java side of RXTX does not recognize that portname. Trying modifying src/RXTXCommDriver.java as described in this case: http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card From ajmas at sympatico.ca Sun Apr 20 16:37:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Apr 2008 18:37:59 -0400 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <480B0DEA.5010908@m-plify.com> References: <480B0DEA.5010908@m-plify.com> Message-ID: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > Jeff Larsen wrote: >> Next I tried RXTX on Linux, but I'm getting >> NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX >> on Solaris > It might be that the Java side of RXTX does not recognize that > portname. > Trying modifying src/RXTXCommDriver.java as described in this case: > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card I wonder whether it would be worth allowing custom port prefixes as a system parameter? For example: gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" Andre From Martin.Oberhuber at windriver.com Tue Apr 22 12:34:36 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 22 Apr 2008 20:34:36 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> References: <480B0DEA.5010908@m-plify.com> <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE6485848056CD6CE@ism-mail03.corp.ad.wrs.com> Sounds like a great idea... I'm wondering how the "variable part" after the Prefixes could be specified though? What about allowing Regular Expression character Classes in the existing System Property for specifying ports: System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyS[0-9],ttyS[ABC],ttyUSB[0-9a-z]"); The set of allowed patterns would of course need to Be restricted compared to REGEX, because it must be A syntax that supports iterating over it. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Montag, 21. April 2008 00:38 > To: rxtx at qbang.org and Users > Subject: Re: [Rxtx] Moxa serial over Ethernet driver > > > On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > > Jeff Larsen wrote: > >> Next I tried RXTX on Linux, but I'm getting > >> NoSuchPortException connecting to /dev/ttyr00. I have yet > to try RXTX > >> on Solaris > > It might be that the Java side of RXTX does not recognize that > > portname. > > Trying modifying src/RXTXCommDriver.java as described in this case: > > > > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_ > SST-4P.2FLP_multiport_card > > I wonder whether it would be worth allowing custom port > prefixes as a > system parameter? For > example: > > gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Loi.TRAN at weatherford.com Tue Apr 22 13:10:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Tue, 22 Apr 2008 14:10:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled Message-ID: Hi, I'm currently using the Java RXTX API to interface to a serial port. The serial port is connected to a bridge board that communicates with our communications system running at 1.875 Mbps which is linked to an embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no flow control). I send a command to the embedded board through the serial-bridge board which then is relayed to the embedded board. The command sent asks the embedded board to dump a binary image. Here's where I'm hitting some problems. I've successfully done this is an integrated serial port from the laptop. The binary file that comes back is consistent on every attempt. When I use the application I've written to do the same thing with a USB-to-serial adapter, the image I get back is not the same as the image I receive through the USB-to-serial adapter is not consistent at all. A final thing is that when I use a terminal program to dump the binary image with the USB-serial adapter, the image is correct. Every time! What is the terminal program doing that's not being done in my application? My application is quite simple. Has anyone observed this behavior before? If you have, I'd like to know how you've gotten around this problem. Thanks, LT =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From tjarvi at qbang.org Tue Apr 22 21:11:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 22 Apr 2008 21:11:10 -0600 (MDT) Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org From Loi.TRAN at weatherford.com Wed Apr 23 08:35:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Wed, 23 Apr 2008 09:35:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: Thanks for all the responses. I finally tried something that worked consistently. I updated my Prolific driver and repeated my tests. It worked. If you're using the Prolific type USB-serial adapters, do no use the Prolific version 2.0.2.1 driver on Windows. Update it to the latest 2.0.2.8 version. Again, thanks for all the responses. LT -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Tuesday, April 22, 2008 10:11 PM To: TRAN, Loi X. Cc: rxtx at qbang.org Subject: Re: [Rxtx] Prolific USB - RXTX data mangled On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From Martin.Oberhuber at windriver.com Wed Apr 23 18:54:26 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 02:54:26 +0200 Subject: [Rxtx] RXTX port locking on Linux status? Message-ID: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Dear RXTX community, I'm wondering what the status is with RXTX locking serial ports on Linux? My understanding is that the mechanism used in 2.1-7r2 (lockfiles) is not really state of the art, and has lots of problems (e.g. missing permissions). There was an idea to migrate towards a Kernel syscall based solution for port locking. What's the status here? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/9878db9f/attachment-0021.html From tjarvi at qbang.org Wed Apr 23 20:32:24 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Apr 2008 20:32:24 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > Dear RXTX community, > > I'm wondering what the status is with RXTX locking > serial ports on Linux? > > My understanding is that the mechanism used in > 2.1-7r2 (lockfiles) is not really state of the art, and > has lots of problems (e.g. missing permissions). > > There was an idea to migrate towards a Kernel > syscall based solution for port locking. > > What's the status here? > Hi Martin, I'm in favor of deprecating the current FHS locking mechanism in favor of an IOCTL when available. I think it will be available on all the platforms but do not know for sure. The status is unchanged. I've had very few free cycles for such things. Feel free to take a stab at it if you have some time. I believe the IOCTL is used in the Mac OS X code already. I don't see any real backwards compatability issues and the IOCTL should just work. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Apr 24 06:14:06 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 14:14:06 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Thanks Trent. Problem is only that I'm really not at all Familiar with the C part of RXTX. If there Were anything I could do in Java for this, It would be easier for me.... ... Are there any C experts here on the list Who'd like to look at ioctl port locking For linux? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Donnerstag, 24. April 2008 04:32 > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > I'm wondering what the status is with RXTX locking > > serial ports on Linux? > > > > My understanding is that the mechanism used in > > 2.1-7r2 (lockfiles) is not really state of the art, and > > has lots of problems (e.g. missing permissions). > > > > There was an idea to migrate towards a Kernel > > syscall based solution for port locking. > > > > What's the status here? > > > > Hi Martin, > > I'm in favor of deprecating the current FHS locking mechanism > in favor of > an IOCTL when available. I think it will be available on all the > platforms but do not know for sure. > > The status is unchanged. I've had very few free cycles for > such things. > Feel free to take a stab at it if you have some time. I > believe the IOCTL > is used in the Mac OS X code already. > > I don't see any real backwards compatability issues and the > IOCTL should > just work. > > -- > Trent Jarvi > tjarvi at qbang.org > From sspies at sloc.de Thu Apr 24 07:15:36 2008 From: sspies at sloc.de (Sebastian Spies) Date: Thu, 24 Apr 2008 15:15:36 +0200 (CEST) Subject: [Rxtx] rxtx on gumstix: Interrupted system call In-Reply-To: <47FB7B20.7080504@sloc.de> References: <47FB7B20.7080504@sloc.de> Message-ID: <55445.130.83.139.205.1209042936.squirrel@ssl.sloc.de> Dear list, while porting rxtx to the gumstix, I found out, that select used in readArray in SerialImp.c might not work as expected. Maybe, because of missing TIOCSERGETLSR-support? select is often interrupted, so i wrote the following quick'n'dirty hack to make it work on gumstix: diff -Nur rxtx-2.1-7r2/src/SerialImp.c rxtx-2.1-7r2/src/SerialImp.c --- rxtx-2.1-7r2/src/SerialImp.c 2006-01-29 23:19:04.000000000 +0100 +++ rxtx-2.1-7r2-patched/src/SerialImp.c 2008-04-24 14:30:17.000000000 +0200 @@ -3380,7 +3381,7 @@ JNIEXPORT jint JNICALL RXTXPort(readArray)( JNIEnv *env, jobject jobj, jbyteArray jbarray, jint offset, jint length ) { - int bytes; + int bytes = 0; jbyte *body; /* char msg[80]; */ int fd = get_java_var( env, jobj, "fd", "I" ); @@ -3397,9 +3398,18 @@ "readArray", "Invalid length" ); return -1; } - body = (*env)->GetByteArrayElements( env, jbarray, 0 ); - bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ - (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + while(1 > bytes) + { + body = (*env)->GetByteArrayElements( env, jbarray, 0 ); + bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ + (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + // quick'n'dirty - SSP + report (" trying again... \n"); + errno = 0; + } + if( bytes < 0 ) { report( "RXTXPort:readArray bytes < 0" ); LEAVE( "RXTXPort:readArray" ); > Hey, > > I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use > RXTXPort$SerialInputStream.read(), then I get the following Exception. I > did not yet figure out which system call is interrupted as strace > produces loads of output. > > Any help would be very appreciated. Thanks in advance. > Sebastian > > > [java] java.io.IOException: Interrupted system call in readArray > [java] at gnu.io.RXTXPort.readArray(Native Method) > [java] at > gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) > [java] at > java.io.FilterInputStream.read(FilterInputStream.java:189) > [java] at > java.io.BufferedInputStream.refill(BufferedInputStream.java:371) > [java] at > java.io.BufferedInputStream.read(BufferedInputStream.java:229) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) > [java] at > com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) > > -- > Sebastian Spies > > mail: sspies at sloc.de > > > > From fire_baptized at hotmail.com Thu Apr 24 18:27:48 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Thu, 24 Apr 2008 20:27:48 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hello I am having a problem with the serial device connecting (software wise) to the serial port. However I have a test program and it seems to work just fine in that environment - and it doesnt use GUI. The error I am getting is : PortNotFoundException Now the way I have it setup in the GUI environment is that once the user pushes a JButton the program connects using this class: protected void establishConnection() { try { portId = CommPortIdentifier.getPortIdentifier("COM3"); System.out.println("Establishing connction....."); messages[0] = "\nEstablishing connction.....\n"; } catch ( NoSuchPortException noport) { System.out.println("Port not found: "+ noport); messages[0] = "Port not found: "+ noport+"\n"; } try { serialPort = (SerialPort) portId.open("serial", 50); System.out.println("Port has been found."); messages[1] = "Port has been found.\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[1] = "" +usedport; } try { serialPort = (SerialPort) portId.open("serial", 50); messages[2] = "Connecting to COM3 on port 50....\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; } try { serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); System.out.println("Esablishing the transfer rate settings for COM3."); messages[3] = "Esablishing the transfer rate settings for COM3.\n"; } catch (UnsupportedCommOperationException nosupcom) { System.out.println(nosupcom); System.out.println("The tranfer rate could not be esblished on COM3."); messages[3] = "The tranfer rate could not be esblished on COM3.\n"; } System.out.println(serialPort.getFlowControlMode()); messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; //sendDataOut(buffer[3],buffer[4]); } I need all the data in this method (and all the string values in this method) to be printed out on a JTextArea. I wont do me any good if not all the text is printed on a JTextArea in another class. So I have the text printing the JTextArea correctly, but everytime the JButton is activated - it gives me that error message. I did add a disconnect button that is supposed to call the serialPort.close(). _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/273fd4ec/attachment-0020.html From tjarvi at qbang.org Thu Apr 24 21:54:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Apr 2008 21:54:10 -0600 (MDT) Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > Hello I am having a problem with the serial device connecting (software > wise) to the serial port. However I have a test program and it seems to > work just fine in that environment - and it doesnt use GUI. The error I > am getting is : PortNotFoundException Now the way I have it setup in the > GUI environment is that once the user pushes a JButton the program > connects using this class: > > protected void establishConnection() { > try { > portId = CommPortIdentifier.getPortIdentifier("COM3"); > System.out.println("Establishing connction....."); > messages[0] = "\nEstablishing connction.....\n"; > } > catch ( NoSuchPortException noport) { > System.out.println("Port not found: "+ noport); > messages[0] = "Port not found: "+ noport+"\n"; > } > try { > serialPort = (SerialPort) portId.open("serial", 50); > System.out.println("Port has been found."); > messages[1] = "Port has been found.\n"; > } > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[1] = "" +usedport; > } ================================================================= > try { > serialPort = (SerialPort) portId.open("serial", 50); > messages[2] = "Connecting to COM3 on port 50....\n"; > } ================================================================== > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > } > try { > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > System.out.println("Esablishing the transfer rate settings for COM3."); > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > } > catch (UnsupportedCommOperationException nosupcom) { > System.out.println(nosupcom); > System.out.println("The tranfer rate could not be esblished on COM3."); > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > } > System.out.println(serialPort.getFlowControlMode()); > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > //sendDataOut(buffer[3],buffer[4]); > } > > I need all the data in this method (and all the string values in this > method) to be printed out on a JTextArea. I wont do me any good if not > all the text is printed on a JTextArea in another class. So I have the > text printing the JTextArea correctly, but everytime the JButton is > activated - it gives me that error message. I did add a disconnect > button that is supposed to call the serialPort.close(). > The open code used twice is going to throw an exception. It may be that you catch the exception above this code and print a confusing message? A common mistake is people will accidently run two copies of their program. The first instance of the program will open the port and prevent enumeration (finding the port) in the second instance of the program. As an example, you may be running your text based application which is preventing the GUI from seeing the port. Enumeration is done by trying to open the port. If the port is open, Enumeration fails. -- Trent Jarvi tjarvi at qbang.org From fire_baptized at hotmail.com Thu Apr 24 22:32:05 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 00:32:05 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Wow - thanks dude what a dumb thing for me to not catch..... now here is the current problem - right now I am trying to output data again one is with the test program - and it seems that serialPort.setRTS(true); is throwing an exceptions there - now if I show this code please bare in mind that I am only testing - the code is kinda sloppy in my mind - but if I can figure out why calling this function is throwing an exception then maybe I can figure out why my GUI application is getting the same null pointer exceptions when try to send out the data stream. FYI Trent this email is not directed towards you - anyone can jump in on this public static void main(String args[]) { byte[] b = new byte[64]; int keyinput = 0 ; byte x = 0; byte y = 0; PortTesting1 testports = new PortTesting1(); try { joyskoro = Joystick.createInstance(); } catch (IOException ioexc) { System.out.println("There is an input/output problem: " + ioexc); } while (true) { joyskoro.poll(); b[0] = ((byte) -(10 * joyskoro.getY())); b[1] = ((byte) (10 * joyskoro.getX())); System.out.println("The 3rd byte is: " +b[0]); System.out.println("The 4rd byte is: " +b[1]); serialPort.setRTS(true); // HERE IS WHERE THE PROBLEM IS !!!!!!! ON THIS LINE but if I dont have it active in my program the Bluetooth device (that is System.out.println("Ready to send :-) !"); //connected to the serial port does not send out data!!!!! if (joyskoro.isButtonDown(joyskoro.BUTTON10)) { System.out.println("Connection terminated."); serialPort.close(); break; } if (joyskoro.isButtonDown(joyskoro.BUTTON2)) { boolean flag = true; //reading from key input from the keyboard System.out.println("Please input a command: "); while (flag) { try { keyinput = System.in.read(); } catch (IOException ioexc) {/*there is no need to put * anything here */ } if((char)keyinput=='w') { pushIt((byte)85); } if((char)keyinput=='s') { pushIt((byte)84); } if((char)keyinput=='a') { pushIt((byte)83); } if((char)keyinput=='d') { pushIt((byte)82); } if((char)keyinput=='q') { pushIt((byte)89); } if((char)keyinput=='\t') { //this stop reading input from the keyboard flag = false; } } and help anyways here is the block of code that throwing an exception for the test program: > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/5c8f7d68/attachment-0020.html From fire_baptized at hotmail.com Fri Apr 25 07:59:53 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 09:59:53 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Are there any examples of how to push out data? As in using input and output streams - if I can compare code maybe I can see where this is causing a problem. I have a byte array that I am pushing out data. I keep getting null pointer exceptions every where I turn. > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/22228ab6/attachment-0019.html From ajmas at sympatico.ca Sat Apr 26 07:37:09 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 26 Apr 2008 09:37:09 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hi, On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote: > > Are there any examples of how to push out data? As in using input > and output streams - if I can compare code maybe I can see where > this is causing a problem. I have a byte array that I am pushing > out data. I keep getting null pointer exceptions every where I turn. > There are some examples here that might be of help: http://rxtx.qbang.org/wiki/index.php/Examples Andre From fire_baptized at hotmail.com Sat Apr 26 20:13:54 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Sat, 26 Apr 2008 22:13:54 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: looked at those....yep didnt help - I need to push out data with GUI and not get a null pointer exception everytime I try. > CC: rxtx at qbang.org> From: ajmas at sympatico.ca> To: fire_baptized at hotmail.com> Subject: Re: [Rxtx] Serial Problems with Gui.....> Date: Sat, 26 Apr 2008 09:37:09 -0400> > Hi,> > > On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote:> >> > Are there any examples of how to push out data? As in using input > > and output streams - if I can compare code maybe I can see where > > this is causing a problem. I have a byte array that I am pushing > > out data. I keep getting null pointer exceptions every where I turn.> >> > There are some examples here that might be of help:> > http://rxtx.qbang.org/wiki/index.php/Examples> > Andre _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080426/09f95b41/attachment-0018.html From michael.erskine at ketech.com Mon Apr 28 02:47:22 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 28 Apr 2008 09:47:22 +0100 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D426EF3CBBC5@no-sv-03.ketech.local> Jesrael D. Summerhill wrote: > looked at those....yep didnt help - I need to push out data with GUI and > not get a null pointer exception everytime I try. So it seems pretty obvious that your code needs to check for nulls wherever one may occur and report what's happening. Alternatively, catch the npe and display the stack trace. Then you can fix your code so it doesn't try to work with something that ain't there. Regards, Michael Erskine. From scldad at sdc.com.au Mon Apr 28 03:58:34 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Mon, 28 Apr 2008 19:28:34 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Message-ID: <200804281928.34454.scldad@sdc.com.au> Has anybody done any design work on this? The first thing that springs to mind is that we still need to check for lock files because other apps tend to use that approach even if we go to ioctl. Cheers, Stephen Davies On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > Thanks Trent. > > Problem is only that I'm really not at all > Familiar with the C part of RXTX. If there > Were anything I could do in Java for this, > It would be easier for me.... > > ... Are there any C experts here on the list > Who'd like to look at ioctl port locking > For linux? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > -----Original Message----- > > From: Trent Jarvi [mailto:tjarvi at qbang.org] > > Sent: Donnerstag, 24. April 2008 04:32 > > To: Oberhuber, Martin > > Cc: rxtx at qbang.org > > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > > > I'm wondering what the status is with RXTX locking > > > serial ports on Linux? > > > > > > My understanding is that the mechanism used in > > > 2.1-7r2 (lockfiles) is not really state of the art, and > > > has lots of problems (e.g. missing permissions). > > > > > > There was an idea to migrate towards a Kernel > > > syscall based solution for port locking. > > > > > > What's the status here? > > > > Hi Martin, > > > > I'm in favor of deprecating the current FHS locking mechanism > > in favor of > > an IOCTL when available. I think it will be available on all the > > platforms but do not know for sure. > > > > The status is unchanged. I've had very few free cycles for > > such things. > > Feel free to take a stab at it if you have some time. I > > believe the IOCTL > > is used in the Mac OS X code already. > > > > I don't see any real backwards compatability issues and the > > IOCTL should > > just work. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Mon Apr 28 04:21:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 28 Apr 2008 04:21:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804281928.34454.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: I don't think there would need to be any architectural changes. A couple ifdefs and minor changes in the current code should be enough. Proposal: FHS/UUCP locks: continue to respect them, try to create them but do not error if the IOCTL is supported. (But does the IOCTL being defined mean it will work?) Enumeration: Do not assert the IOCTL while opening. Serial.open: assert the IOCTL after open. Continue to use locks as described above after asserting the IOCTL. If the IOCTL is defined but not working, handle it here. Failure cases include the IOCTL is not supported and the port is already locked. On Mon, 28 Apr 2008, Stephen Davies wrote: > Has anybody done any design work on this? > The first thing that springs to mind is that we still need to check for lock > files because other apps tend to use that approach even if we go to ioctl. > > Cheers, > Stephen Davies > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: >> Thanks Trent. >> >> Problem is only that I'm really not at all >> Familiar with the C part of RXTX. If there >> Were anything I could do in Java for this, >> It would be easier for me.... >> >> ... Are there any C experts here on the list >> Who'd like to look at ioctl port locking >> For linux? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >>> -----Original Message----- >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] >>> Sent: Donnerstag, 24. April 2008 04:32 >>> To: Oberhuber, Martin >>> Cc: rxtx at qbang.org >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? >>> >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: >>>> Dear RXTX community, >>>> >>>> I'm wondering what the status is with RXTX locking >>>> serial ports on Linux? >>>> >>>> My understanding is that the mechanism used in >>>> 2.1-7r2 (lockfiles) is not really state of the art, and >>>> has lots of problems (e.g. missing permissions). >>>> >>>> There was an idea to migrate towards a Kernel >>>> syscall based solution for port locking. >>>> >>>> What's the status here? >>> >>> Hi Martin, >>> >>> I'm in favor of deprecating the current FHS locking mechanism >>> in favor of >>> an IOCTL when available. I think it will be available on all the >>> platforms but do not know for sure. >>> >>> The status is unchanged. I've had very few free cycles for >>> such things. >>> Feel free to take a stab at it if you have some time. I >>> believe the IOCTL >>> is used in the Mac OS X code already. >>> >>> I don't see any real backwards compatability issues and the >>> IOCTL should >>> just work. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Tue Apr 29 12:04:04 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Apr 2008 20:04:04 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Hi all, The biggest problem that I have seen with lockfiles on Linux At least is, that it seems there is no standard with respect To the folder in which they should be created. Also, many Distributions seem to set up file system permissions in such A way that writing to the lockfile folder is not allowed for The normal user -- that's why we stopped using lockfiles In our commercial product. If we are to still respect lockfiles, we first need to Understand where we are expected to look for them. Does Anybody have any insight what variants of lockfile folder Schema exist out there in the wild? Some apps like minicom Seem to even allow users to manually specify a lockfile Folder of their choice. Because of the difficulty finding the right lockfile folder, And because of the inherent risk of thinking that something Might be locked while it actually isn't, I'd suggest that RXTX should have a "soft-off" feature that allows disabling ALL Lockfile checks at runtime without recompiling the native Sharedlibs. Trent - I like your strategy outline, but I think that it Needs to be configurable by the client such that users and/or Customer Support can disable lockfiles / disable ioctl in Case they detect that they are runing on an OS / Kernal that Does not support one or the other. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Montag, 28. April 2008 12:22 > To: Stephen Davies > Cc: rxtx at qbang.org; Oberhuber, Martin; Trent Jarvi > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > I don't think there would need to be any architectural > changes. A couple > ifdefs and minor changes in the current code should be enough. > > Proposal: > > FHS/UUCP locks: > continue to respect them, try to create them but do not error if > the IOCTL is supported. (But does the IOCTL being defined mean > it will work?) > Enumeration: > Do not assert the IOCTL while opening. > Serial.open: > assert the IOCTL after open. Continue to use locks as described > above after asserting the IOCTL. If the IOCTL is defined but > not working, handle it here. Failure cases include the IOCTL > is not supported and the port is already locked. > > On Mon, 28 Apr 2008, Stephen Davies wrote: > > > Has anybody done any design work on this? > > The first thing that springs to mind is that we still need > to check for lock > > files because other apps tend to use that approach even if > we go to ioctl. > > > > Cheers, > > Stephen Davies > > > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > >> Thanks Trent. > >> > >> Problem is only that I'm really not at all > >> Familiar with the C part of RXTX. If there > >> Were anything I could do in Java for this, > >> It would be easier for me.... > >> > >> ... Are there any C experts here on the list > >> Who'd like to look at ioctl port locking > >> For linux? > >> > >> Thanks, > >> -- > >> Martin Oberhuber, Senior Member of Technical Staff, Wind River > >> Target Management Project Lead, DSDP PMC Member > >> http://www.eclipse.org/dsdp/tm > >> > >>> -----Original Message----- > >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] > >>> Sent: Donnerstag, 24. April 2008 04:32 > >>> To: Oberhuber, Martin > >>> Cc: rxtx at qbang.org > >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? > >>> > >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > >>>> Dear RXTX community, > >>>> > >>>> I'm wondering what the status is with RXTX locking > >>>> serial ports on Linux? > >>>> > >>>> My understanding is that the mechanism used in > >>>> 2.1-7r2 (lockfiles) is not really state of the art, and > >>>> has lots of problems (e.g. missing permissions). > >>>> > >>>> There was an idea to migrate towards a Kernel > >>>> syscall based solution for port locking. > >>>> > >>>> What's the status here? > >>> > >>> Hi Martin, > >>> > >>> I'm in favor of deprecating the current FHS locking mechanism > >>> in favor of > >>> an IOCTL when available. I think it will be available on all the > >>> platforms but do not know for sure. > >>> > >>> The status is unchanged. I've had very few free cycles for > >>> such things. > >>> Feel free to take a stab at it if you have some time. I > >>> believe the IOCTL > >>> is used in the Mac OS X code already. > >>> > >>> I don't see any real backwards compatability issues and the > >>> IOCTL should > >>> just work. > >>> > >>> -- > >>> Trent Jarvi > >>> tjarvi at qbang.org > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > From Steffen.DETTMER at ingenico.com Tue Apr 29 13:34:44 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 29 Apr 2008 21:34:44 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Message-ID: <20080429193444.GU2928@elberon.bln.de.ingenico.com> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > The biggest problem that I have seen with lockfiles on Linux > At least is, that it seems there is no standard with respect > To the folder in which they should be created. Also, many > Distributions seem to set up file system permissions in such > A way that writing to the lockfile folder is not allowed for > The normal user -- that's why we stopped using lockfiles > In our commercial product. It seems it depends on the expectations. I consider it as a feature that by default a linux user cannot access serial ports. Maybe root connected a modem (can produce phone bills) or even some serial card reader, maybe with the web servers key pair. I would expect that by default a user cannot open the serial port because of insufficient permissions on the device file. I would expect this on other unices as well (but I don't know it). For windows I think it should be similar but not impacting so much in practice, because often windows users work with big permissions on a somewhat high priviledge level or even Administrator. > If we are to still respect lockfiles, we first need to > Understand where we are expected to look for them. Does > Anybody have any insight what variants of lockfile folder > Schema exist out there in the wild? Some apps like minicom > Seem to even allow users to manually specify a lockfile > Folder of their choice. At least my (ancient) minicom does not allow the user to change this option, it is displayed but read-only, but root is allowed to change it. > Because of the difficulty finding the right lockfile folder, > And because of the inherent risk of thinking that something > Might be locked while it actually isn't, I'd suggest that > RXTX should have a "soft-off" feature that allows disabling > ALL Lockfile checks at runtime without recompiling the native > Sharedlibs. sounds very reasonable, yes... and as admin I would not wish that users could skip such locking because they do things wrong by default ;) (in the end I guess that is related to the dilemma, that hotplug/user-owned-periphery and multi-user systems simply conflict) > Trent - I like your strategy outline, but I think that it > Needs to be configurable by the client such that users and/or > Customer Support can disable lockfiles / disable ioctl in > Case they detect that they are runing on an OS / Kernal that > Does not support one or the other. Yes, this would be good I guess... Applications could offer configuration options to control that, maybe similarily as minicom. BTW, man minicom tells: *B - Lock file location On most systems This should be /usr/spool/uucp. Linux systems use /var/lock. If this directory does not exist, minicom will not attempt to use lockfiles. The statement `Linux systems use /var/lock' is interesting, does anyone know the source of this convention? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Tue Apr 29 16:11:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Apr 2008 16:11:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? These details are outlined in the Filesystem Hierarchy Standard (FHS). http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLOCKLOCKFILES -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Tue Apr 29 18:58:09 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Wed, 30 Apr 2008 10:28:09 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: <200804301028.09307.scldad@sdc.com.au> I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is the same. Any ideas as to how to handle this? Stephen On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: > * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > > The biggest problem that I have seen with lockfiles on Linux > > At least is, that it seems there is no standard with respect > > To the folder in which they should be created. Also, many > > Distributions seem to set up file system permissions in such > > A way that writing to the lockfile folder is not allowed for > > The normal user -- that's why we stopped using lockfiles > > In our commercial product. > > It seems it depends on the expectations. I consider it as a > feature that by default a linux user cannot access serial ports. > Maybe root connected a modem (can produce phone bills) or even > some serial card reader, maybe with the web servers key pair. > > I would expect that by default a user cannot open the serial port > because of insufficient permissions on the device file. I would > expect this on other unices as well (but I don't know it). > > For windows I think it should be similar but not impacting so > much in practice, because often windows users work with big > permissions on a somewhat high priviledge level or even > Administrator. > > > If we are to still respect lockfiles, we first need to > > Understand where we are expected to look for them. Does > > Anybody have any insight what variants of lockfile folder > > Schema exist out there in the wild? Some apps like minicom > > Seem to even allow users to manually specify a lockfile > > Folder of their choice. > > At least my (ancient) minicom does not allow the user to change > this option, it is displayed but read-only, but root is allowed > to change it. > > > Because of the difficulty finding the right lockfile folder, > > And because of the inherent risk of thinking that something > > Might be locked while it actually isn't, I'd suggest that > > RXTX should have a "soft-off" feature that allows disabling > > ALL Lockfile checks at runtime without recompiling the native > > Sharedlibs. > > sounds very reasonable, yes... > and as admin I would not wish that users could skip such > locking because they do things wrong by default ;) > > (in the end I guess that is related to the dilemma, that > hotplug/user-owned-periphery and multi-user systems simply > conflict) > > > Trent - I like your strategy outline, but I think that it > > Needs to be configurable by the client such that users and/or > > Customer Support can disable lockfiles / disable ioctl in > > Case they detect that they are runing on an OS / Kernal that > > Does not support one or the other. > > Yes, this would be good I guess... Applications could offer > configuration options to control that, maybe similarily as > minicom. > > BTW, man minicom tells: > > *B - Lock file location > On most systems This should be /usr/spool/uucp. > Linux systems use /var/lock. If this directory > does not exist, minicom will not attempt to use > lockfiles. > > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure > and expedient electronic transaction acceptance. Ingenico products leverage > proven technology, established standards and unparalleled ergonomics to > provide optimal reliability, versatility and usability. This comprehensive > range of products is complemented by a global array of services and > partnerships, enabling businesses in a number of vertical sectors to accept > transactions anywhere their business takes them. www.ingenico.com This > message may contain confidential and/or privileged information. If you are > not the addressee or authorized to receive this for the addressee, you must > not use, copy, disclose or take any action based on this message or any > information herein. If you have received this message in error, please > advise the sender immediately by reply e-mail and delete this message. > Thank you for your cooperation. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Wed Apr 30 19:30:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 30 Apr 2008 19:30:51 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804301028.09307.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> <200804301028.09307.scldad@sdc.com.au> Message-ID: Hi Stephen, I suspect ioctl/TIOCEXCL open/O_EXCL would do the job. Mac uses TIOCEXCL and it is POSIX. We use O_EXCL for lockfiles on Linux already. On Wed, 30 Apr 2008, Stephen Davies wrote: > I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is > the same. > > Any ideas as to how to handle this? > > Stephen > > > On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: >> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: >>> The biggest problem that I have seen with lockfiles on Linux >>> At least is, that it seems there is no standard with respect >>> To the folder in which they should be created. Also, many >>> Distributions seem to set up file system permissions in such >>> A way that writing to the lockfile folder is not allowed for >>> The normal user -- that's why we stopped using lockfiles >>> In our commercial product. >> >> It seems it depends on the expectations. I consider it as a >> feature that by default a linux user cannot access serial ports. >> Maybe root connected a modem (can produce phone bills) or even >> some serial card reader, maybe with the web servers key pair. >> >> I would expect that by default a user cannot open the serial port >> because of insufficient permissions on the device file. I would >> expect this on other unices as well (but I don't know it). >> >> For windows I think it should be similar but not impacting so >> much in practice, because often windows users work with big >> permissions on a somewhat high priviledge level or even >> Administrator. >> >>> If we are to still respect lockfiles, we first need to >>> Understand where we are expected to look for them. Does >>> Anybody have any insight what variants of lockfile folder >>> Schema exist out there in the wild? Some apps like minicom >>> Seem to even allow users to manually specify a lockfile >>> Folder of their choice. >> >> At least my (ancient) minicom does not allow the user to change >> this option, it is displayed but read-only, but root is allowed >> to change it. >> >>> Because of the difficulty finding the right lockfile folder, >>> And because of the inherent risk of thinking that something >>> Might be locked while it actually isn't, I'd suggest that >>> RXTX should have a "soft-off" feature that allows disabling >>> ALL Lockfile checks at runtime without recompiling the native >>> Sharedlibs. >> >> sounds very reasonable, yes... >> and as admin I would not wish that users could skip such >> locking because they do things wrong by default ;) >> >> (in the end I guess that is related to the dilemma, that >> hotplug/user-owned-periphery and multi-user systems simply >> conflict) >> >>> Trent - I like your strategy outline, but I think that it >>> Needs to be configurable by the client such that users and/or >>> Customer Support can disable lockfiles / disable ioctl in >>> Case they detect that they are runing on an OS / Kernal that >>> Does not support one or the other. >> >> Yes, this would be good I guess... Applications could offer >> configuration options to control that, maybe similarily as >> minicom. >> >> BTW, man minicom tells: >> >> *B - Lock file location >> On most systems This should be /usr/spool/uucp. >> Linux systems use /var/lock. If this directory >> does not exist, minicom will not attempt to use >> lockfiles. >> >> The statement `Linux systems use /var/lock' is interesting, does >> anyone know the source of this convention? >> >> oki, >> >> Steffen >> >> About Ingenico Throughout the world businesses rely on Ingenico for secure >> and expedient electronic transaction acceptance. Ingenico products leverage >> proven technology, established standards and unparalleled ergonomics to >> provide optimal reliability, versatility and usability. This comprehensive >> range of products is complemented by a global array of services and >> partnerships, enabling businesses in a number of vertical sectors to accept >> transactions anywhere their business takes them. www.ingenico.com This >> message may contain confidential and/or privileged information. If you are >> not the addressee or authorized to receive this for the addressee, you must >> not use, copy, disclose or take any action based on this message or any >> information herein. If you have received this message in error, please >> advise the sender immediately by reply e-mail and delete this message. >> Thank you for your cooperation. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0044.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0042.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0029.html From pboulton at pulsetracer.com Fri Apr 18 14:30:13 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Fri, 18 Apr 2008 13:30:13 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site Message-ID: <480904D5.1060307@pulsetracer.com> Hello, gentle serial porters. I have downloaded the zipped up binaries for use on Windows without Sun's CommAPI, but don't seem able to extract anything from the download. Go to main page, http://www.rxtx.org/ Click on Downloads I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) And I save it to disk. If I try and extract the files with WinZip, Winzip thinks the archive is corrupt. If I try using Windows Explorer, I am able to extract it into a single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than the original .zip. Any help would be much appreciated. Sincerely, Philip Boulton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080418/97d89793/attachment-0027.html From tjarvi at qbang.org Fri Apr 18 19:07:00 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 18 Apr 2008 19:07:00 -0600 (MDT) Subject: [Rxtx] Difficulty opening zip file at rxtx site In-Reply-To: <480904D5.1060307@pulsetracer.com> References: <480904D5.1060307@pulsetracer.com> Message-ID: On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org From pboulton at pulsetracer.com Sat Apr 19 12:46:26 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Sat, 19 Apr 2008 11:46:26 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site References: <480904D5.1060307@pulsetracer.com> Message-ID: <53DB7576450695419E09299104043761A78533@ZTGSERVER.ztg.local> I have been able to get my hands on the binaries, by going to the ftp directory /pub/rxtx at ftp.qbang.org,, and ftping the file rxtx-2.1-7-bins-r2.zip . This opens happily with Winzip, and extracts as the set of files that you describe below. I only experience the ill-formed archive problem by clicking the link on the rxtx.org Downloads page (http://rxtx.qbang.org/pub/rxtx/ rxtx-2.1-7-bins-r2.zip ). Not sure what to make of that. Philip Boulton ________________________________ From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Fri 4/18/2008 6:07 PM To: Philip Boulton Cc: rxtx at qbang.org Subject: Re: [Rxtx] Difficulty opening zip file at rxtx site On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080419/147923bb/attachment-0026.html From jlar310 at gmail.com Sat Apr 19 19:11:55 2008 From: jlar310 at gmail.com (Jeff Larsen) Date: Sat, 19 Apr 2008 20:11:55 -0500 Subject: [Rxtx] Moxa serial over Ethernet driver Message-ID: Hi all, I've been using javax.comm for years to communicate with a legacy radio data system. We want to migrate the java side of the system to a VMware Server virtual machine. We've had great success using Moxa DE-303 and 5610 serial over Ethernet appliances and virtual machines for running hylafax. The OS (Linux in this case) uses a kernel driver to communicate with the Moxa via a virtual serial port such as /dev/ttyr00. I want to do the same thing with javax.comm or gnu.io to connect to a virtual serial port. However I'm hitting road blocks everywhere. javax.comm for Linux sees the virtual port, but there are transmission errors. Tried Solaris too, but the Solaris Moxa drivers don't play nice with javax.comm because the driver uses /dev/pts/n instead of /dev/term/x. Next I tried RXTX on Linux, but I'm getting NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX on Solaris. Has anyone used RXTX with serial over Ethernet devices? Any hints on how to make it work? I know that I'm not completely off track because javax.comm does work with Moxa on a Windows platform, but that's just not an option for production deployment. -- Jeff From tjarvi at qbang.org Sat Apr 19 21:08:41 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 19 Apr 2008 21:08:41 -0600 (MDT) Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: yOn Sat, 19 Apr 2008, Jeff Larsen wrote: > Hi all, > > I've been using javax.comm for years to communicate with a legacy > radio data system. We want to migrate the java side of the system to a > VMware Server virtual machine. We've had great success using Moxa > DE-303 and 5610 serial over Ethernet appliances and virtual machines > for running hylafax. The OS (Linux in this case) uses a kernel driver > to communicate with the Moxa via a virtual serial port such as > /dev/ttyr00. > > I want to do the same thing with javax.comm or gnu.io to connect to a > virtual serial port. However I'm hitting road blocks everywhere. > javax.comm for Linux sees the virtual port, but there are transmission > errors. Tried Solaris too, but the Solaris Moxa drivers don't play > nice with javax.comm because the driver uses /dev/pts/n instead of > /dev/term/x. Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris. > > Has anyone used RXTX with serial over Ethernet devices? Any hints on > how to make it work? > > I know that I'm not completely off track because javax.comm does work > with Moxa on a Windows platform, but that's just not an option for > production deployment. > > Moxa should work under linux. There may be minor issues depending upon how complete the kernel driver is but I think it will work. One of the minor issues is /dev/ttyr00 is not enumerated. There are several work arounds documented with the source code and on the wiki. The easiest solution for testing purposes is to make a symbolic link from /dev/ttyr00 to a port that is enumerated such as /dev/ttyS129. You can later alter the rxtx source or use properties to change the enumerated ports. -- Trent Jarvi tjarvi at qbang.org From d.tonhofer at m-plify.com Sun Apr 20 03:33:30 2008 From: d.tonhofer at m-plify.com (David Tonhofer (M-PLIFY S.A.)) Date: Sun, 20 Apr 2008 11:33:30 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: <480B0DEA.5010908@m-plify.com> Jeff Larsen wrote: > Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris It might be that the Java side of RXTX does not recognize that portname. Trying modifying src/RXTXCommDriver.java as described in this case: http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card From ajmas at sympatico.ca Sun Apr 20 16:37:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Apr 2008 18:37:59 -0400 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <480B0DEA.5010908@m-plify.com> References: <480B0DEA.5010908@m-plify.com> Message-ID: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > Jeff Larsen wrote: >> Next I tried RXTX on Linux, but I'm getting >> NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX >> on Solaris > It might be that the Java side of RXTX does not recognize that > portname. > Trying modifying src/RXTXCommDriver.java as described in this case: > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card I wonder whether it would be worth allowing custom port prefixes as a system parameter? For example: gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" Andre From Martin.Oberhuber at windriver.com Tue Apr 22 12:34:36 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 22 Apr 2008 20:34:36 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> References: <480B0DEA.5010908@m-plify.com> <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE6485848056CD6CE@ism-mail03.corp.ad.wrs.com> Sounds like a great idea... I'm wondering how the "variable part" after the Prefixes could be specified though? What about allowing Regular Expression character Classes in the existing System Property for specifying ports: System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyS[0-9],ttyS[ABC],ttyUSB[0-9a-z]"); The set of allowed patterns would of course need to Be restricted compared to REGEX, because it must be A syntax that supports iterating over it. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Montag, 21. April 2008 00:38 > To: rxtx at qbang.org and Users > Subject: Re: [Rxtx] Moxa serial over Ethernet driver > > > On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > > Jeff Larsen wrote: > >> Next I tried RXTX on Linux, but I'm getting > >> NoSuchPortException connecting to /dev/ttyr00. I have yet > to try RXTX > >> on Solaris > > It might be that the Java side of RXTX does not recognize that > > portname. > > Trying modifying src/RXTXCommDriver.java as described in this case: > > > > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_ > SST-4P.2FLP_multiport_card > > I wonder whether it would be worth allowing custom port > prefixes as a > system parameter? For > example: > > gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Loi.TRAN at weatherford.com Tue Apr 22 13:10:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Tue, 22 Apr 2008 14:10:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled Message-ID: Hi, I'm currently using the Java RXTX API to interface to a serial port. The serial port is connected to a bridge board that communicates with our communications system running at 1.875 Mbps which is linked to an embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no flow control). I send a command to the embedded board through the serial-bridge board which then is relayed to the embedded board. The command sent asks the embedded board to dump a binary image. Here's where I'm hitting some problems. I've successfully done this is an integrated serial port from the laptop. The binary file that comes back is consistent on every attempt. When I use the application I've written to do the same thing with a USB-to-serial adapter, the image I get back is not the same as the image I receive through the USB-to-serial adapter is not consistent at all. A final thing is that when I use a terminal program to dump the binary image with the USB-serial adapter, the image is correct. Every time! What is the terminal program doing that's not being done in my application? My application is quite simple. Has anyone observed this behavior before? If you have, I'd like to know how you've gotten around this problem. Thanks, LT =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From tjarvi at qbang.org Tue Apr 22 21:11:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 22 Apr 2008 21:11:10 -0600 (MDT) Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org From Loi.TRAN at weatherford.com Wed Apr 23 08:35:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Wed, 23 Apr 2008 09:35:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: Thanks for all the responses. I finally tried something that worked consistently. I updated my Prolific driver and repeated my tests. It worked. If you're using the Prolific type USB-serial adapters, do no use the Prolific version 2.0.2.1 driver on Windows. Update it to the latest 2.0.2.8 version. Again, thanks for all the responses. LT -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Tuesday, April 22, 2008 10:11 PM To: TRAN, Loi X. Cc: rxtx at qbang.org Subject: Re: [Rxtx] Prolific USB - RXTX data mangled On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From Martin.Oberhuber at windriver.com Wed Apr 23 18:54:26 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 02:54:26 +0200 Subject: [Rxtx] RXTX port locking on Linux status? Message-ID: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Dear RXTX community, I'm wondering what the status is with RXTX locking serial ports on Linux? My understanding is that the mechanism used in 2.1-7r2 (lockfiles) is not really state of the art, and has lots of problems (e.g. missing permissions). There was an idea to migrate towards a Kernel syscall based solution for port locking. What's the status here? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/9878db9f/attachment-0022.html From tjarvi at qbang.org Wed Apr 23 20:32:24 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Apr 2008 20:32:24 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > Dear RXTX community, > > I'm wondering what the status is with RXTX locking > serial ports on Linux? > > My understanding is that the mechanism used in > 2.1-7r2 (lockfiles) is not really state of the art, and > has lots of problems (e.g. missing permissions). > > There was an idea to migrate towards a Kernel > syscall based solution for port locking. > > What's the status here? > Hi Martin, I'm in favor of deprecating the current FHS locking mechanism in favor of an IOCTL when available. I think it will be available on all the platforms but do not know for sure. The status is unchanged. I've had very few free cycles for such things. Feel free to take a stab at it if you have some time. I believe the IOCTL is used in the Mac OS X code already. I don't see any real backwards compatability issues and the IOCTL should just work. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Apr 24 06:14:06 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 14:14:06 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Thanks Trent. Problem is only that I'm really not at all Familiar with the C part of RXTX. If there Were anything I could do in Java for this, It would be easier for me.... ... Are there any C experts here on the list Who'd like to look at ioctl port locking For linux? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Donnerstag, 24. April 2008 04:32 > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > I'm wondering what the status is with RXTX locking > > serial ports on Linux? > > > > My understanding is that the mechanism used in > > 2.1-7r2 (lockfiles) is not really state of the art, and > > has lots of problems (e.g. missing permissions). > > > > There was an idea to migrate towards a Kernel > > syscall based solution for port locking. > > > > What's the status here? > > > > Hi Martin, > > I'm in favor of deprecating the current FHS locking mechanism > in favor of > an IOCTL when available. I think it will be available on all the > platforms but do not know for sure. > > The status is unchanged. I've had very few free cycles for > such things. > Feel free to take a stab at it if you have some time. I > believe the IOCTL > is used in the Mac OS X code already. > > I don't see any real backwards compatability issues and the > IOCTL should > just work. > > -- > Trent Jarvi > tjarvi at qbang.org > From sspies at sloc.de Thu Apr 24 07:15:36 2008 From: sspies at sloc.de (Sebastian Spies) Date: Thu, 24 Apr 2008 15:15:36 +0200 (CEST) Subject: [Rxtx] rxtx on gumstix: Interrupted system call In-Reply-To: <47FB7B20.7080504@sloc.de> References: <47FB7B20.7080504@sloc.de> Message-ID: <55445.130.83.139.205.1209042936.squirrel@ssl.sloc.de> Dear list, while porting rxtx to the gumstix, I found out, that select used in readArray in SerialImp.c might not work as expected. Maybe, because of missing TIOCSERGETLSR-support? select is often interrupted, so i wrote the following quick'n'dirty hack to make it work on gumstix: diff -Nur rxtx-2.1-7r2/src/SerialImp.c rxtx-2.1-7r2/src/SerialImp.c --- rxtx-2.1-7r2/src/SerialImp.c 2006-01-29 23:19:04.000000000 +0100 +++ rxtx-2.1-7r2-patched/src/SerialImp.c 2008-04-24 14:30:17.000000000 +0200 @@ -3380,7 +3381,7 @@ JNIEXPORT jint JNICALL RXTXPort(readArray)( JNIEnv *env, jobject jobj, jbyteArray jbarray, jint offset, jint length ) { - int bytes; + int bytes = 0; jbyte *body; /* char msg[80]; */ int fd = get_java_var( env, jobj, "fd", "I" ); @@ -3397,9 +3398,18 @@ "readArray", "Invalid length" ); return -1; } - body = (*env)->GetByteArrayElements( env, jbarray, 0 ); - bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ - (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + while(1 > bytes) + { + body = (*env)->GetByteArrayElements( env, jbarray, 0 ); + bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ + (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + // quick'n'dirty - SSP + report (" trying again... \n"); + errno = 0; + } + if( bytes < 0 ) { report( "RXTXPort:readArray bytes < 0" ); LEAVE( "RXTXPort:readArray" ); > Hey, > > I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use > RXTXPort$SerialInputStream.read(), then I get the following Exception. I > did not yet figure out which system call is interrupted as strace > produces loads of output. > > Any help would be very appreciated. Thanks in advance. > Sebastian > > > [java] java.io.IOException: Interrupted system call in readArray > [java] at gnu.io.RXTXPort.readArray(Native Method) > [java] at > gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) > [java] at > java.io.FilterInputStream.read(FilterInputStream.java:189) > [java] at > java.io.BufferedInputStream.refill(BufferedInputStream.java:371) > [java] at > java.io.BufferedInputStream.read(BufferedInputStream.java:229) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) > [java] at > com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) > > -- > Sebastian Spies > > mail: sspies at sloc.de > > > > From fire_baptized at hotmail.com Thu Apr 24 18:27:48 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Thu, 24 Apr 2008 20:27:48 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hello I am having a problem with the serial device connecting (software wise) to the serial port. However I have a test program and it seems to work just fine in that environment - and it doesnt use GUI. The error I am getting is : PortNotFoundException Now the way I have it setup in the GUI environment is that once the user pushes a JButton the program connects using this class: protected void establishConnection() { try { portId = CommPortIdentifier.getPortIdentifier("COM3"); System.out.println("Establishing connction....."); messages[0] = "\nEstablishing connction.....\n"; } catch ( NoSuchPortException noport) { System.out.println("Port not found: "+ noport); messages[0] = "Port not found: "+ noport+"\n"; } try { serialPort = (SerialPort) portId.open("serial", 50); System.out.println("Port has been found."); messages[1] = "Port has been found.\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[1] = "" +usedport; } try { serialPort = (SerialPort) portId.open("serial", 50); messages[2] = "Connecting to COM3 on port 50....\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; } try { serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); System.out.println("Esablishing the transfer rate settings for COM3."); messages[3] = "Esablishing the transfer rate settings for COM3.\n"; } catch (UnsupportedCommOperationException nosupcom) { System.out.println(nosupcom); System.out.println("The tranfer rate could not be esblished on COM3."); messages[3] = "The tranfer rate could not be esblished on COM3.\n"; } System.out.println(serialPort.getFlowControlMode()); messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; //sendDataOut(buffer[3],buffer[4]); } I need all the data in this method (and all the string values in this method) to be printed out on a JTextArea. I wont do me any good if not all the text is printed on a JTextArea in another class. So I have the text printing the JTextArea correctly, but everytime the JButton is activated - it gives me that error message. I did add a disconnect button that is supposed to call the serialPort.close(). _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/273fd4ec/attachment-0021.html From tjarvi at qbang.org Thu Apr 24 21:54:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Apr 2008 21:54:10 -0600 (MDT) Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > Hello I am having a problem with the serial device connecting (software > wise) to the serial port. However I have a test program and it seems to > work just fine in that environment - and it doesnt use GUI. The error I > am getting is : PortNotFoundException Now the way I have it setup in the > GUI environment is that once the user pushes a JButton the program > connects using this class: > > protected void establishConnection() { > try { > portId = CommPortIdentifier.getPortIdentifier("COM3"); > System.out.println("Establishing connction....."); > messages[0] = "\nEstablishing connction.....\n"; > } > catch ( NoSuchPortException noport) { > System.out.println("Port not found: "+ noport); > messages[0] = "Port not found: "+ noport+"\n"; > } > try { > serialPort = (SerialPort) portId.open("serial", 50); > System.out.println("Port has been found."); > messages[1] = "Port has been found.\n"; > } > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[1] = "" +usedport; > } ================================================================= > try { > serialPort = (SerialPort) portId.open("serial", 50); > messages[2] = "Connecting to COM3 on port 50....\n"; > } ================================================================== > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > } > try { > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > System.out.println("Esablishing the transfer rate settings for COM3."); > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > } > catch (UnsupportedCommOperationException nosupcom) { > System.out.println(nosupcom); > System.out.println("The tranfer rate could not be esblished on COM3."); > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > } > System.out.println(serialPort.getFlowControlMode()); > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > //sendDataOut(buffer[3],buffer[4]); > } > > I need all the data in this method (and all the string values in this > method) to be printed out on a JTextArea. I wont do me any good if not > all the text is printed on a JTextArea in another class. So I have the > text printing the JTextArea correctly, but everytime the JButton is > activated - it gives me that error message. I did add a disconnect > button that is supposed to call the serialPort.close(). > The open code used twice is going to throw an exception. It may be that you catch the exception above this code and print a confusing message? A common mistake is people will accidently run two copies of their program. The first instance of the program will open the port and prevent enumeration (finding the port) in the second instance of the program. As an example, you may be running your text based application which is preventing the GUI from seeing the port. Enumeration is done by trying to open the port. If the port is open, Enumeration fails. -- Trent Jarvi tjarvi at qbang.org From fire_baptized at hotmail.com Thu Apr 24 22:32:05 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 00:32:05 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Wow - thanks dude what a dumb thing for me to not catch..... now here is the current problem - right now I am trying to output data again one is with the test program - and it seems that serialPort.setRTS(true); is throwing an exceptions there - now if I show this code please bare in mind that I am only testing - the code is kinda sloppy in my mind - but if I can figure out why calling this function is throwing an exception then maybe I can figure out why my GUI application is getting the same null pointer exceptions when try to send out the data stream. FYI Trent this email is not directed towards you - anyone can jump in on this public static void main(String args[]) { byte[] b = new byte[64]; int keyinput = 0 ; byte x = 0; byte y = 0; PortTesting1 testports = new PortTesting1(); try { joyskoro = Joystick.createInstance(); } catch (IOException ioexc) { System.out.println("There is an input/output problem: " + ioexc); } while (true) { joyskoro.poll(); b[0] = ((byte) -(10 * joyskoro.getY())); b[1] = ((byte) (10 * joyskoro.getX())); System.out.println("The 3rd byte is: " +b[0]); System.out.println("The 4rd byte is: " +b[1]); serialPort.setRTS(true); // HERE IS WHERE THE PROBLEM IS !!!!!!! ON THIS LINE but if I dont have it active in my program the Bluetooth device (that is System.out.println("Ready to send :-) !"); //connected to the serial port does not send out data!!!!! if (joyskoro.isButtonDown(joyskoro.BUTTON10)) { System.out.println("Connection terminated."); serialPort.close(); break; } if (joyskoro.isButtonDown(joyskoro.BUTTON2)) { boolean flag = true; //reading from key input from the keyboard System.out.println("Please input a command: "); while (flag) { try { keyinput = System.in.read(); } catch (IOException ioexc) {/*there is no need to put * anything here */ } if((char)keyinput=='w') { pushIt((byte)85); } if((char)keyinput=='s') { pushIt((byte)84); } if((char)keyinput=='a') { pushIt((byte)83); } if((char)keyinput=='d') { pushIt((byte)82); } if((char)keyinput=='q') { pushIt((byte)89); } if((char)keyinput=='\t') { //this stop reading input from the keyboard flag = false; } } and help anyways here is the block of code that throwing an exception for the test program: > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/5c8f7d68/attachment-0021.html From fire_baptized at hotmail.com Fri Apr 25 07:59:53 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 09:59:53 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Are there any examples of how to push out data? As in using input and output streams - if I can compare code maybe I can see where this is causing a problem. I have a byte array that I am pushing out data. I keep getting null pointer exceptions every where I turn. > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/22228ab6/attachment-0020.html From ajmas at sympatico.ca Sat Apr 26 07:37:09 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 26 Apr 2008 09:37:09 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hi, On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote: > > Are there any examples of how to push out data? As in using input > and output streams - if I can compare code maybe I can see where > this is causing a problem. I have a byte array that I am pushing > out data. I keep getting null pointer exceptions every where I turn. > There are some examples here that might be of help: http://rxtx.qbang.org/wiki/index.php/Examples Andre From fire_baptized at hotmail.com Sat Apr 26 20:13:54 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Sat, 26 Apr 2008 22:13:54 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: looked at those....yep didnt help - I need to push out data with GUI and not get a null pointer exception everytime I try. > CC: rxtx at qbang.org> From: ajmas at sympatico.ca> To: fire_baptized at hotmail.com> Subject: Re: [Rxtx] Serial Problems with Gui.....> Date: Sat, 26 Apr 2008 09:37:09 -0400> > Hi,> > > On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote:> >> > Are there any examples of how to push out data? As in using input > > and output streams - if I can compare code maybe I can see where > > this is causing a problem. I have a byte array that I am pushing > > out data. I keep getting null pointer exceptions every where I turn.> >> > There are some examples here that might be of help:> > http://rxtx.qbang.org/wiki/index.php/Examples> > Andre _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080426/09f95b41/attachment-0019.html From michael.erskine at ketech.com Mon Apr 28 02:47:22 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 28 Apr 2008 09:47:22 +0100 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D426EF3CBBC5@no-sv-03.ketech.local> Jesrael D. Summerhill wrote: > looked at those....yep didnt help - I need to push out data with GUI and > not get a null pointer exception everytime I try. So it seems pretty obvious that your code needs to check for nulls wherever one may occur and report what's happening. Alternatively, catch the npe and display the stack trace. Then you can fix your code so it doesn't try to work with something that ain't there. Regards, Michael Erskine. From scldad at sdc.com.au Mon Apr 28 03:58:34 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Mon, 28 Apr 2008 19:28:34 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Message-ID: <200804281928.34454.scldad@sdc.com.au> Has anybody done any design work on this? The first thing that springs to mind is that we still need to check for lock files because other apps tend to use that approach even if we go to ioctl. Cheers, Stephen Davies On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > Thanks Trent. > > Problem is only that I'm really not at all > Familiar with the C part of RXTX. If there > Were anything I could do in Java for this, > It would be easier for me.... > > ... Are there any C experts here on the list > Who'd like to look at ioctl port locking > For linux? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > -----Original Message----- > > From: Trent Jarvi [mailto:tjarvi at qbang.org] > > Sent: Donnerstag, 24. April 2008 04:32 > > To: Oberhuber, Martin > > Cc: rxtx at qbang.org > > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > > > I'm wondering what the status is with RXTX locking > > > serial ports on Linux? > > > > > > My understanding is that the mechanism used in > > > 2.1-7r2 (lockfiles) is not really state of the art, and > > > has lots of problems (e.g. missing permissions). > > > > > > There was an idea to migrate towards a Kernel > > > syscall based solution for port locking. > > > > > > What's the status here? > > > > Hi Martin, > > > > I'm in favor of deprecating the current FHS locking mechanism > > in favor of > > an IOCTL when available. I think it will be available on all the > > platforms but do not know for sure. > > > > The status is unchanged. I've had very few free cycles for > > such things. > > Feel free to take a stab at it if you have some time. I > > believe the IOCTL > > is used in the Mac OS X code already. > > > > I don't see any real backwards compatability issues and the > > IOCTL should > > just work. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Mon Apr 28 04:21:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 28 Apr 2008 04:21:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804281928.34454.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: I don't think there would need to be any architectural changes. A couple ifdefs and minor changes in the current code should be enough. Proposal: FHS/UUCP locks: continue to respect them, try to create them but do not error if the IOCTL is supported. (But does the IOCTL being defined mean it will work?) Enumeration: Do not assert the IOCTL while opening. Serial.open: assert the IOCTL after open. Continue to use locks as described above after asserting the IOCTL. If the IOCTL is defined but not working, handle it here. Failure cases include the IOCTL is not supported and the port is already locked. On Mon, 28 Apr 2008, Stephen Davies wrote: > Has anybody done any design work on this? > The first thing that springs to mind is that we still need to check for lock > files because other apps tend to use that approach even if we go to ioctl. > > Cheers, > Stephen Davies > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: >> Thanks Trent. >> >> Problem is only that I'm really not at all >> Familiar with the C part of RXTX. If there >> Were anything I could do in Java for this, >> It would be easier for me.... >> >> ... Are there any C experts here on the list >> Who'd like to look at ioctl port locking >> For linux? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >>> -----Original Message----- >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] >>> Sent: Donnerstag, 24. April 2008 04:32 >>> To: Oberhuber, Martin >>> Cc: rxtx at qbang.org >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? >>> >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: >>>> Dear RXTX community, >>>> >>>> I'm wondering what the status is with RXTX locking >>>> serial ports on Linux? >>>> >>>> My understanding is that the mechanism used in >>>> 2.1-7r2 (lockfiles) is not really state of the art, and >>>> has lots of problems (e.g. missing permissions). >>>> >>>> There was an idea to migrate towards a Kernel >>>> syscall based solution for port locking. >>>> >>>> What's the status here? >>> >>> Hi Martin, >>> >>> I'm in favor of deprecating the current FHS locking mechanism >>> in favor of >>> an IOCTL when available. I think it will be available on all the >>> platforms but do not know for sure. >>> >>> The status is unchanged. I've had very few free cycles for >>> such things. >>> Feel free to take a stab at it if you have some time. I >>> believe the IOCTL >>> is used in the Mac OS X code already. >>> >>> I don't see any real backwards compatability issues and the >>> IOCTL should >>> just work. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Tue Apr 29 12:04:04 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Apr 2008 20:04:04 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Hi all, The biggest problem that I have seen with lockfiles on Linux At least is, that it seems there is no standard with respect To the folder in which they should be created. Also, many Distributions seem to set up file system permissions in such A way that writing to the lockfile folder is not allowed for The normal user -- that's why we stopped using lockfiles In our commercial product. If we are to still respect lockfiles, we first need to Understand where we are expected to look for them. Does Anybody have any insight what variants of lockfile folder Schema exist out there in the wild? Some apps like minicom Seem to even allow users to manually specify a lockfile Folder of their choice. Because of the difficulty finding the right lockfile folder, And because of the inherent risk of thinking that something Might be locked while it actually isn't, I'd suggest that RXTX should have a "soft-off" feature that allows disabling ALL Lockfile checks at runtime without recompiling the native Sharedlibs. Trent - I like your strategy outline, but I think that it Needs to be configurable by the client such that users and/or Customer Support can disable lockfiles / disable ioctl in Case they detect that they are runing on an OS / Kernal that Does not support one or the other. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Montag, 28. April 2008 12:22 > To: Stephen Davies > Cc: rxtx at qbang.org; Oberhuber, Martin; Trent Jarvi > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > I don't think there would need to be any architectural > changes. A couple > ifdefs and minor changes in the current code should be enough. > > Proposal: > > FHS/UUCP locks: > continue to respect them, try to create them but do not error if > the IOCTL is supported. (But does the IOCTL being defined mean > it will work?) > Enumeration: > Do not assert the IOCTL while opening. > Serial.open: > assert the IOCTL after open. Continue to use locks as described > above after asserting the IOCTL. If the IOCTL is defined but > not working, handle it here. Failure cases include the IOCTL > is not supported and the port is already locked. > > On Mon, 28 Apr 2008, Stephen Davies wrote: > > > Has anybody done any design work on this? > > The first thing that springs to mind is that we still need > to check for lock > > files because other apps tend to use that approach even if > we go to ioctl. > > > > Cheers, > > Stephen Davies > > > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > >> Thanks Trent. > >> > >> Problem is only that I'm really not at all > >> Familiar with the C part of RXTX. If there > >> Were anything I could do in Java for this, > >> It would be easier for me.... > >> > >> ... Are there any C experts here on the list > >> Who'd like to look at ioctl port locking > >> For linux? > >> > >> Thanks, > >> -- > >> Martin Oberhuber, Senior Member of Technical Staff, Wind River > >> Target Management Project Lead, DSDP PMC Member > >> http://www.eclipse.org/dsdp/tm > >> > >>> -----Original Message----- > >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] > >>> Sent: Donnerstag, 24. April 2008 04:32 > >>> To: Oberhuber, Martin > >>> Cc: rxtx at qbang.org > >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? > >>> > >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > >>>> Dear RXTX community, > >>>> > >>>> I'm wondering what the status is with RXTX locking > >>>> serial ports on Linux? > >>>> > >>>> My understanding is that the mechanism used in > >>>> 2.1-7r2 (lockfiles) is not really state of the art, and > >>>> has lots of problems (e.g. missing permissions). > >>>> > >>>> There was an idea to migrate towards a Kernel > >>>> syscall based solution for port locking. > >>>> > >>>> What's the status here? > >>> > >>> Hi Martin, > >>> > >>> I'm in favor of deprecating the current FHS locking mechanism > >>> in favor of > >>> an IOCTL when available. I think it will be available on all the > >>> platforms but do not know for sure. > >>> > >>> The status is unchanged. I've had very few free cycles for > >>> such things. > >>> Feel free to take a stab at it if you have some time. I > >>> believe the IOCTL > >>> is used in the Mac OS X code already. > >>> > >>> I don't see any real backwards compatability issues and the > >>> IOCTL should > >>> just work. > >>> > >>> -- > >>> Trent Jarvi > >>> tjarvi at qbang.org > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > From Steffen.DETTMER at ingenico.com Tue Apr 29 13:34:44 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 29 Apr 2008 21:34:44 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Message-ID: <20080429193444.GU2928@elberon.bln.de.ingenico.com> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > The biggest problem that I have seen with lockfiles on Linux > At least is, that it seems there is no standard with respect > To the folder in which they should be created. Also, many > Distributions seem to set up file system permissions in such > A way that writing to the lockfile folder is not allowed for > The normal user -- that's why we stopped using lockfiles > In our commercial product. It seems it depends on the expectations. I consider it as a feature that by default a linux user cannot access serial ports. Maybe root connected a modem (can produce phone bills) or even some serial card reader, maybe with the web servers key pair. I would expect that by default a user cannot open the serial port because of insufficient permissions on the device file. I would expect this on other unices as well (but I don't know it). For windows I think it should be similar but not impacting so much in practice, because often windows users work with big permissions on a somewhat high priviledge level or even Administrator. > If we are to still respect lockfiles, we first need to > Understand where we are expected to look for them. Does > Anybody have any insight what variants of lockfile folder > Schema exist out there in the wild? Some apps like minicom > Seem to even allow users to manually specify a lockfile > Folder of their choice. At least my (ancient) minicom does not allow the user to change this option, it is displayed but read-only, but root is allowed to change it. > Because of the difficulty finding the right lockfile folder, > And because of the inherent risk of thinking that something > Might be locked while it actually isn't, I'd suggest that > RXTX should have a "soft-off" feature that allows disabling > ALL Lockfile checks at runtime without recompiling the native > Sharedlibs. sounds very reasonable, yes... and as admin I would not wish that users could skip such locking because they do things wrong by default ;) (in the end I guess that is related to the dilemma, that hotplug/user-owned-periphery and multi-user systems simply conflict) > Trent - I like your strategy outline, but I think that it > Needs to be configurable by the client such that users and/or > Customer Support can disable lockfiles / disable ioctl in > Case they detect that they are runing on an OS / Kernal that > Does not support one or the other. Yes, this would be good I guess... Applications could offer configuration options to control that, maybe similarily as minicom. BTW, man minicom tells: *B - Lock file location On most systems This should be /usr/spool/uucp. Linux systems use /var/lock. If this directory does not exist, minicom will not attempt to use lockfiles. The statement `Linux systems use /var/lock' is interesting, does anyone know the source of this convention? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Tue Apr 29 16:11:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Apr 2008 16:11:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? These details are outlined in the Filesystem Hierarchy Standard (FHS). http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLOCKLOCKFILES -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Tue Apr 29 18:58:09 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Wed, 30 Apr 2008 10:28:09 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: <200804301028.09307.scldad@sdc.com.au> I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is the same. Any ideas as to how to handle this? Stephen On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: > * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > > The biggest problem that I have seen with lockfiles on Linux > > At least is, that it seems there is no standard with respect > > To the folder in which they should be created. Also, many > > Distributions seem to set up file system permissions in such > > A way that writing to the lockfile folder is not allowed for > > The normal user -- that's why we stopped using lockfiles > > In our commercial product. > > It seems it depends on the expectations. I consider it as a > feature that by default a linux user cannot access serial ports. > Maybe root connected a modem (can produce phone bills) or even > some serial card reader, maybe with the web servers key pair. > > I would expect that by default a user cannot open the serial port > because of insufficient permissions on the device file. I would > expect this on other unices as well (but I don't know it). > > For windows I think it should be similar but not impacting so > much in practice, because often windows users work with big > permissions on a somewhat high priviledge level or even > Administrator. > > > If we are to still respect lockfiles, we first need to > > Understand where we are expected to look for them. Does > > Anybody have any insight what variants of lockfile folder > > Schema exist out there in the wild? Some apps like minicom > > Seem to even allow users to manually specify a lockfile > > Folder of their choice. > > At least my (ancient) minicom does not allow the user to change > this option, it is displayed but read-only, but root is allowed > to change it. > > > Because of the difficulty finding the right lockfile folder, > > And because of the inherent risk of thinking that something > > Might be locked while it actually isn't, I'd suggest that > > RXTX should have a "soft-off" feature that allows disabling > > ALL Lockfile checks at runtime without recompiling the native > > Sharedlibs. > > sounds very reasonable, yes... > and as admin I would not wish that users could skip such > locking because they do things wrong by default ;) > > (in the end I guess that is related to the dilemma, that > hotplug/user-owned-periphery and multi-user systems simply > conflict) > > > Trent - I like your strategy outline, but I think that it > > Needs to be configurable by the client such that users and/or > > Customer Support can disable lockfiles / disable ioctl in > > Case they detect that they are runing on an OS / Kernal that > > Does not support one or the other. > > Yes, this would be good I guess... Applications could offer > configuration options to control that, maybe similarily as > minicom. > > BTW, man minicom tells: > > *B - Lock file location > On most systems This should be /usr/spool/uucp. > Linux systems use /var/lock. If this directory > does not exist, minicom will not attempt to use > lockfiles. > > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure > and expedient electronic transaction acceptance. Ingenico products leverage > proven technology, established standards and unparalleled ergonomics to > provide optimal reliability, versatility and usability. This comprehensive > range of products is complemented by a global array of services and > partnerships, enabling businesses in a number of vertical sectors to accept > transactions anywhere their business takes them. www.ingenico.com This > message may contain confidential and/or privileged information. If you are > not the addressee or authorized to receive this for the addressee, you must > not use, copy, disclose or take any action based on this message or any > information herein. If you have received this message in error, please > advise the sender immediately by reply e-mail and delete this message. > Thank you for your cooperation. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Wed Apr 30 19:30:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 30 Apr 2008 19:30:51 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804301028.09307.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> <200804301028.09307.scldad@sdc.com.au> Message-ID: Hi Stephen, I suspect ioctl/TIOCEXCL open/O_EXCL would do the job. Mac uses TIOCEXCL and it is POSIX. We use O_EXCL for lockfiles on Linux already. On Wed, 30 Apr 2008, Stephen Davies wrote: > I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is > the same. > > Any ideas as to how to handle this? > > Stephen > > > On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: >> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: >>> The biggest problem that I have seen with lockfiles on Linux >>> At least is, that it seems there is no standard with respect >>> To the folder in which they should be created. Also, many >>> Distributions seem to set up file system permissions in such >>> A way that writing to the lockfile folder is not allowed for >>> The normal user -- that's why we stopped using lockfiles >>> In our commercial product. >> >> It seems it depends on the expectations. I consider it as a >> feature that by default a linux user cannot access serial ports. >> Maybe root connected a modem (can produce phone bills) or even >> some serial card reader, maybe with the web servers key pair. >> >> I would expect that by default a user cannot open the serial port >> because of insufficient permissions on the device file. I would >> expect this on other unices as well (but I don't know it). >> >> For windows I think it should be similar but not impacting so >> much in practice, because often windows users work with big >> permissions on a somewhat high priviledge level or even >> Administrator. >> >>> If we are to still respect lockfiles, we first need to >>> Understand where we are expected to look for them. Does >>> Anybody have any insight what variants of lockfile folder >>> Schema exist out there in the wild? Some apps like minicom >>> Seem to even allow users to manually specify a lockfile >>> Folder of their choice. >> >> At least my (ancient) minicom does not allow the user to change >> this option, it is displayed but read-only, but root is allowed >> to change it. >> >>> Because of the difficulty finding the right lockfile folder, >>> And because of the inherent risk of thinking that something >>> Might be locked while it actually isn't, I'd suggest that >>> RXTX should have a "soft-off" feature that allows disabling >>> ALL Lockfile checks at runtime without recompiling the native >>> Sharedlibs. >> >> sounds very reasonable, yes... >> and as admin I would not wish that users could skip such >> locking because they do things wrong by default ;) >> >> (in the end I guess that is related to the dilemma, that >> hotplug/user-owned-periphery and multi-user systems simply >> conflict) >> >>> Trent - I like your strategy outline, but I think that it >>> Needs to be configurable by the client such that users and/or >>> Customer Support can disable lockfiles / disable ioctl in >>> Case they detect that they are runing on an OS / Kernal that >>> Does not support one or the other. >> >> Yes, this would be good I guess... Applications could offer >> configuration options to control that, maybe similarily as >> minicom. >> >> BTW, man minicom tells: >> >> *B - Lock file location >> On most systems This should be /usr/spool/uucp. >> Linux systems use /var/lock. If this directory >> does not exist, minicom will not attempt to use >> lockfiles. >> >> The statement `Linux systems use /var/lock' is interesting, does >> anyone know the source of this convention? >> >> oki, >> >> Steffen >> >> About Ingenico Throughout the world businesses rely on Ingenico for secure >> and expedient electronic transaction acceptance. Ingenico products leverage >> proven technology, established standards and unparalleled ergonomics to >> provide optimal reliability, versatility and usability. This comprehensive >> range of products is complemented by a global array of services and >> partnerships, enabling businesses in a number of vertical sectors to accept >> transactions anywhere their business takes them. www.ingenico.com This >> message may contain confidential and/or privileged information. If you are >> not the addressee or authorized to receive this for the addressee, you must >> not use, copy, disclose or take any action based on this message or any >> information herein. If you have received this message in error, please >> advise the sender immediately by reply e-mail and delete this message. >> Thank you for your cooperation. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0045.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0043.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0030.html From pboulton at pulsetracer.com Fri Apr 18 14:30:13 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Fri, 18 Apr 2008 13:30:13 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site Message-ID: <480904D5.1060307@pulsetracer.com> Hello, gentle serial porters. I have downloaded the zipped up binaries for use on Windows without Sun's CommAPI, but don't seem able to extract anything from the download. Go to main page, http://www.rxtx.org/ Click on Downloads I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) And I save it to disk. If I try and extract the files with WinZip, Winzip thinks the archive is corrupt. If I try using Windows Explorer, I am able to extract it into a single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than the original .zip. Any help would be much appreciated. Sincerely, Philip Boulton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080418/97d89793/attachment-0028.html From tjarvi at qbang.org Fri Apr 18 19:07:00 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 18 Apr 2008 19:07:00 -0600 (MDT) Subject: [Rxtx] Difficulty opening zip file at rxtx site In-Reply-To: <480904D5.1060307@pulsetracer.com> References: <480904D5.1060307@pulsetracer.com> Message-ID: On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org From pboulton at pulsetracer.com Sat Apr 19 12:46:26 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Sat, 19 Apr 2008 11:46:26 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site References: <480904D5.1060307@pulsetracer.com> Message-ID: <53DB7576450695419E09299104043761A78533@ZTGSERVER.ztg.local> I have been able to get my hands on the binaries, by going to the ftp directory /pub/rxtx at ftp.qbang.org,, and ftping the file rxtx-2.1-7-bins-r2.zip . This opens happily with Winzip, and extracts as the set of files that you describe below. I only experience the ill-formed archive problem by clicking the link on the rxtx.org Downloads page (http://rxtx.qbang.org/pub/rxtx/ rxtx-2.1-7-bins-r2.zip ). Not sure what to make of that. Philip Boulton ________________________________ From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Fri 4/18/2008 6:07 PM To: Philip Boulton Cc: rxtx at qbang.org Subject: Re: [Rxtx] Difficulty opening zip file at rxtx site On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080419/147923bb/attachment-0027.html From jlar310 at gmail.com Sat Apr 19 19:11:55 2008 From: jlar310 at gmail.com (Jeff Larsen) Date: Sat, 19 Apr 2008 20:11:55 -0500 Subject: [Rxtx] Moxa serial over Ethernet driver Message-ID: Hi all, I've been using javax.comm for years to communicate with a legacy radio data system. We want to migrate the java side of the system to a VMware Server virtual machine. We've had great success using Moxa DE-303 and 5610 serial over Ethernet appliances and virtual machines for running hylafax. The OS (Linux in this case) uses a kernel driver to communicate with the Moxa via a virtual serial port such as /dev/ttyr00. I want to do the same thing with javax.comm or gnu.io to connect to a virtual serial port. However I'm hitting road blocks everywhere. javax.comm for Linux sees the virtual port, but there are transmission errors. Tried Solaris too, but the Solaris Moxa drivers don't play nice with javax.comm because the driver uses /dev/pts/n instead of /dev/term/x. Next I tried RXTX on Linux, but I'm getting NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX on Solaris. Has anyone used RXTX with serial over Ethernet devices? Any hints on how to make it work? I know that I'm not completely off track because javax.comm does work with Moxa on a Windows platform, but that's just not an option for production deployment. -- Jeff From tjarvi at qbang.org Sat Apr 19 21:08:41 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 19 Apr 2008 21:08:41 -0600 (MDT) Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: yOn Sat, 19 Apr 2008, Jeff Larsen wrote: > Hi all, > > I've been using javax.comm for years to communicate with a legacy > radio data system. We want to migrate the java side of the system to a > VMware Server virtual machine. We've had great success using Moxa > DE-303 and 5610 serial over Ethernet appliances and virtual machines > for running hylafax. The OS (Linux in this case) uses a kernel driver > to communicate with the Moxa via a virtual serial port such as > /dev/ttyr00. > > I want to do the same thing with javax.comm or gnu.io to connect to a > virtual serial port. However I'm hitting road blocks everywhere. > javax.comm for Linux sees the virtual port, but there are transmission > errors. Tried Solaris too, but the Solaris Moxa drivers don't play > nice with javax.comm because the driver uses /dev/pts/n instead of > /dev/term/x. Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris. > > Has anyone used RXTX with serial over Ethernet devices? Any hints on > how to make it work? > > I know that I'm not completely off track because javax.comm does work > with Moxa on a Windows platform, but that's just not an option for > production deployment. > > Moxa should work under linux. There may be minor issues depending upon how complete the kernel driver is but I think it will work. One of the minor issues is /dev/ttyr00 is not enumerated. There are several work arounds documented with the source code and on the wiki. The easiest solution for testing purposes is to make a symbolic link from /dev/ttyr00 to a port that is enumerated such as /dev/ttyS129. You can later alter the rxtx source or use properties to change the enumerated ports. -- Trent Jarvi tjarvi at qbang.org From d.tonhofer at m-plify.com Sun Apr 20 03:33:30 2008 From: d.tonhofer at m-plify.com (David Tonhofer (M-PLIFY S.A.)) Date: Sun, 20 Apr 2008 11:33:30 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: <480B0DEA.5010908@m-plify.com> Jeff Larsen wrote: > Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris It might be that the Java side of RXTX does not recognize that portname. Trying modifying src/RXTXCommDriver.java as described in this case: http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card From ajmas at sympatico.ca Sun Apr 20 16:37:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Apr 2008 18:37:59 -0400 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <480B0DEA.5010908@m-plify.com> References: <480B0DEA.5010908@m-plify.com> Message-ID: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > Jeff Larsen wrote: >> Next I tried RXTX on Linux, but I'm getting >> NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX >> on Solaris > It might be that the Java side of RXTX does not recognize that > portname. > Trying modifying src/RXTXCommDriver.java as described in this case: > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card I wonder whether it would be worth allowing custom port prefixes as a system parameter? For example: gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" Andre From Martin.Oberhuber at windriver.com Tue Apr 22 12:34:36 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 22 Apr 2008 20:34:36 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> References: <480B0DEA.5010908@m-plify.com> <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE6485848056CD6CE@ism-mail03.corp.ad.wrs.com> Sounds like a great idea... I'm wondering how the "variable part" after the Prefixes could be specified though? What about allowing Regular Expression character Classes in the existing System Property for specifying ports: System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyS[0-9],ttyS[ABC],ttyUSB[0-9a-z]"); The set of allowed patterns would of course need to Be restricted compared to REGEX, because it must be A syntax that supports iterating over it. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Montag, 21. April 2008 00:38 > To: rxtx at qbang.org and Users > Subject: Re: [Rxtx] Moxa serial over Ethernet driver > > > On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > > Jeff Larsen wrote: > >> Next I tried RXTX on Linux, but I'm getting > >> NoSuchPortException connecting to /dev/ttyr00. I have yet > to try RXTX > >> on Solaris > > It might be that the Java side of RXTX does not recognize that > > portname. > > Trying modifying src/RXTXCommDriver.java as described in this case: > > > > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_ > SST-4P.2FLP_multiport_card > > I wonder whether it would be worth allowing custom port > prefixes as a > system parameter? For > example: > > gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Loi.TRAN at weatherford.com Tue Apr 22 13:10:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Tue, 22 Apr 2008 14:10:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled Message-ID: Hi, I'm currently using the Java RXTX API to interface to a serial port. The serial port is connected to a bridge board that communicates with our communications system running at 1.875 Mbps which is linked to an embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no flow control). I send a command to the embedded board through the serial-bridge board which then is relayed to the embedded board. The command sent asks the embedded board to dump a binary image. Here's where I'm hitting some problems. I've successfully done this is an integrated serial port from the laptop. The binary file that comes back is consistent on every attempt. When I use the application I've written to do the same thing with a USB-to-serial adapter, the image I get back is not the same as the image I receive through the USB-to-serial adapter is not consistent at all. A final thing is that when I use a terminal program to dump the binary image with the USB-serial adapter, the image is correct. Every time! What is the terminal program doing that's not being done in my application? My application is quite simple. Has anyone observed this behavior before? If you have, I'd like to know how you've gotten around this problem. Thanks, LT =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From tjarvi at qbang.org Tue Apr 22 21:11:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 22 Apr 2008 21:11:10 -0600 (MDT) Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org From Loi.TRAN at weatherford.com Wed Apr 23 08:35:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Wed, 23 Apr 2008 09:35:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: Thanks for all the responses. I finally tried something that worked consistently. I updated my Prolific driver and repeated my tests. It worked. If you're using the Prolific type USB-serial adapters, do no use the Prolific version 2.0.2.1 driver on Windows. Update it to the latest 2.0.2.8 version. Again, thanks for all the responses. LT -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Tuesday, April 22, 2008 10:11 PM To: TRAN, Loi X. Cc: rxtx at qbang.org Subject: Re: [Rxtx] Prolific USB - RXTX data mangled On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From Martin.Oberhuber at windriver.com Wed Apr 23 18:54:26 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 02:54:26 +0200 Subject: [Rxtx] RXTX port locking on Linux status? Message-ID: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Dear RXTX community, I'm wondering what the status is with RXTX locking serial ports on Linux? My understanding is that the mechanism used in 2.1-7r2 (lockfiles) is not really state of the art, and has lots of problems (e.g. missing permissions). There was an idea to migrate towards a Kernel syscall based solution for port locking. What's the status here? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/9878db9f/attachment-0023.html From tjarvi at qbang.org Wed Apr 23 20:32:24 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Apr 2008 20:32:24 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > Dear RXTX community, > > I'm wondering what the status is with RXTX locking > serial ports on Linux? > > My understanding is that the mechanism used in > 2.1-7r2 (lockfiles) is not really state of the art, and > has lots of problems (e.g. missing permissions). > > There was an idea to migrate towards a Kernel > syscall based solution for port locking. > > What's the status here? > Hi Martin, I'm in favor of deprecating the current FHS locking mechanism in favor of an IOCTL when available. I think it will be available on all the platforms but do not know for sure. The status is unchanged. I've had very few free cycles for such things. Feel free to take a stab at it if you have some time. I believe the IOCTL is used in the Mac OS X code already. I don't see any real backwards compatability issues and the IOCTL should just work. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Apr 24 06:14:06 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 14:14:06 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Thanks Trent. Problem is only that I'm really not at all Familiar with the C part of RXTX. If there Were anything I could do in Java for this, It would be easier for me.... ... Are there any C experts here on the list Who'd like to look at ioctl port locking For linux? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Donnerstag, 24. April 2008 04:32 > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > I'm wondering what the status is with RXTX locking > > serial ports on Linux? > > > > My understanding is that the mechanism used in > > 2.1-7r2 (lockfiles) is not really state of the art, and > > has lots of problems (e.g. missing permissions). > > > > There was an idea to migrate towards a Kernel > > syscall based solution for port locking. > > > > What's the status here? > > > > Hi Martin, > > I'm in favor of deprecating the current FHS locking mechanism > in favor of > an IOCTL when available. I think it will be available on all the > platforms but do not know for sure. > > The status is unchanged. I've had very few free cycles for > such things. > Feel free to take a stab at it if you have some time. I > believe the IOCTL > is used in the Mac OS X code already. > > I don't see any real backwards compatability issues and the > IOCTL should > just work. > > -- > Trent Jarvi > tjarvi at qbang.org > From sspies at sloc.de Thu Apr 24 07:15:36 2008 From: sspies at sloc.de (Sebastian Spies) Date: Thu, 24 Apr 2008 15:15:36 +0200 (CEST) Subject: [Rxtx] rxtx on gumstix: Interrupted system call In-Reply-To: <47FB7B20.7080504@sloc.de> References: <47FB7B20.7080504@sloc.de> Message-ID: <55445.130.83.139.205.1209042936.squirrel@ssl.sloc.de> Dear list, while porting rxtx to the gumstix, I found out, that select used in readArray in SerialImp.c might not work as expected. Maybe, because of missing TIOCSERGETLSR-support? select is often interrupted, so i wrote the following quick'n'dirty hack to make it work on gumstix: diff -Nur rxtx-2.1-7r2/src/SerialImp.c rxtx-2.1-7r2/src/SerialImp.c --- rxtx-2.1-7r2/src/SerialImp.c 2006-01-29 23:19:04.000000000 +0100 +++ rxtx-2.1-7r2-patched/src/SerialImp.c 2008-04-24 14:30:17.000000000 +0200 @@ -3380,7 +3381,7 @@ JNIEXPORT jint JNICALL RXTXPort(readArray)( JNIEnv *env, jobject jobj, jbyteArray jbarray, jint offset, jint length ) { - int bytes; + int bytes = 0; jbyte *body; /* char msg[80]; */ int fd = get_java_var( env, jobj, "fd", "I" ); @@ -3397,9 +3398,18 @@ "readArray", "Invalid length" ); return -1; } - body = (*env)->GetByteArrayElements( env, jbarray, 0 ); - bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ - (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + while(1 > bytes) + { + body = (*env)->GetByteArrayElements( env, jbarray, 0 ); + bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ + (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + // quick'n'dirty - SSP + report (" trying again... \n"); + errno = 0; + } + if( bytes < 0 ) { report( "RXTXPort:readArray bytes < 0" ); LEAVE( "RXTXPort:readArray" ); > Hey, > > I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use > RXTXPort$SerialInputStream.read(), then I get the following Exception. I > did not yet figure out which system call is interrupted as strace > produces loads of output. > > Any help would be very appreciated. Thanks in advance. > Sebastian > > > [java] java.io.IOException: Interrupted system call in readArray > [java] at gnu.io.RXTXPort.readArray(Native Method) > [java] at > gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) > [java] at > java.io.FilterInputStream.read(FilterInputStream.java:189) > [java] at > java.io.BufferedInputStream.refill(BufferedInputStream.java:371) > [java] at > java.io.BufferedInputStream.read(BufferedInputStream.java:229) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) > [java] at > com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) > > -- > Sebastian Spies > > mail: sspies at sloc.de > > > > From fire_baptized at hotmail.com Thu Apr 24 18:27:48 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Thu, 24 Apr 2008 20:27:48 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hello I am having a problem with the serial device connecting (software wise) to the serial port. However I have a test program and it seems to work just fine in that environment - and it doesnt use GUI. The error I am getting is : PortNotFoundException Now the way I have it setup in the GUI environment is that once the user pushes a JButton the program connects using this class: protected void establishConnection() { try { portId = CommPortIdentifier.getPortIdentifier("COM3"); System.out.println("Establishing connction....."); messages[0] = "\nEstablishing connction.....\n"; } catch ( NoSuchPortException noport) { System.out.println("Port not found: "+ noport); messages[0] = "Port not found: "+ noport+"\n"; } try { serialPort = (SerialPort) portId.open("serial", 50); System.out.println("Port has been found."); messages[1] = "Port has been found.\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[1] = "" +usedport; } try { serialPort = (SerialPort) portId.open("serial", 50); messages[2] = "Connecting to COM3 on port 50....\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; } try { serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); System.out.println("Esablishing the transfer rate settings for COM3."); messages[3] = "Esablishing the transfer rate settings for COM3.\n"; } catch (UnsupportedCommOperationException nosupcom) { System.out.println(nosupcom); System.out.println("The tranfer rate could not be esblished on COM3."); messages[3] = "The tranfer rate could not be esblished on COM3.\n"; } System.out.println(serialPort.getFlowControlMode()); messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; //sendDataOut(buffer[3],buffer[4]); } I need all the data in this method (and all the string values in this method) to be printed out on a JTextArea. I wont do me any good if not all the text is printed on a JTextArea in another class. So I have the text printing the JTextArea correctly, but everytime the JButton is activated - it gives me that error message. I did add a disconnect button that is supposed to call the serialPort.close(). _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/273fd4ec/attachment-0022.html From tjarvi at qbang.org Thu Apr 24 21:54:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Apr 2008 21:54:10 -0600 (MDT) Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > Hello I am having a problem with the serial device connecting (software > wise) to the serial port. However I have a test program and it seems to > work just fine in that environment - and it doesnt use GUI. The error I > am getting is : PortNotFoundException Now the way I have it setup in the > GUI environment is that once the user pushes a JButton the program > connects using this class: > > protected void establishConnection() { > try { > portId = CommPortIdentifier.getPortIdentifier("COM3"); > System.out.println("Establishing connction....."); > messages[0] = "\nEstablishing connction.....\n"; > } > catch ( NoSuchPortException noport) { > System.out.println("Port not found: "+ noport); > messages[0] = "Port not found: "+ noport+"\n"; > } > try { > serialPort = (SerialPort) portId.open("serial", 50); > System.out.println("Port has been found."); > messages[1] = "Port has been found.\n"; > } > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[1] = "" +usedport; > } ================================================================= > try { > serialPort = (SerialPort) portId.open("serial", 50); > messages[2] = "Connecting to COM3 on port 50....\n"; > } ================================================================== > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > } > try { > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > System.out.println("Esablishing the transfer rate settings for COM3."); > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > } > catch (UnsupportedCommOperationException nosupcom) { > System.out.println(nosupcom); > System.out.println("The tranfer rate could not be esblished on COM3."); > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > } > System.out.println(serialPort.getFlowControlMode()); > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > //sendDataOut(buffer[3],buffer[4]); > } > > I need all the data in this method (and all the string values in this > method) to be printed out on a JTextArea. I wont do me any good if not > all the text is printed on a JTextArea in another class. So I have the > text printing the JTextArea correctly, but everytime the JButton is > activated - it gives me that error message. I did add a disconnect > button that is supposed to call the serialPort.close(). > The open code used twice is going to throw an exception. It may be that you catch the exception above this code and print a confusing message? A common mistake is people will accidently run two copies of their program. The first instance of the program will open the port and prevent enumeration (finding the port) in the second instance of the program. As an example, you may be running your text based application which is preventing the GUI from seeing the port. Enumeration is done by trying to open the port. If the port is open, Enumeration fails. -- Trent Jarvi tjarvi at qbang.org From fire_baptized at hotmail.com Thu Apr 24 22:32:05 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 00:32:05 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Wow - thanks dude what a dumb thing for me to not catch..... now here is the current problem - right now I am trying to output data again one is with the test program - and it seems that serialPort.setRTS(true); is throwing an exceptions there - now if I show this code please bare in mind that I am only testing - the code is kinda sloppy in my mind - but if I can figure out why calling this function is throwing an exception then maybe I can figure out why my GUI application is getting the same null pointer exceptions when try to send out the data stream. FYI Trent this email is not directed towards you - anyone can jump in on this public static void main(String args[]) { byte[] b = new byte[64]; int keyinput = 0 ; byte x = 0; byte y = 0; PortTesting1 testports = new PortTesting1(); try { joyskoro = Joystick.createInstance(); } catch (IOException ioexc) { System.out.println("There is an input/output problem: " + ioexc); } while (true) { joyskoro.poll(); b[0] = ((byte) -(10 * joyskoro.getY())); b[1] = ((byte) (10 * joyskoro.getX())); System.out.println("The 3rd byte is: " +b[0]); System.out.println("The 4rd byte is: " +b[1]); serialPort.setRTS(true); // HERE IS WHERE THE PROBLEM IS !!!!!!! ON THIS LINE but if I dont have it active in my program the Bluetooth device (that is System.out.println("Ready to send :-) !"); //connected to the serial port does not send out data!!!!! if (joyskoro.isButtonDown(joyskoro.BUTTON10)) { System.out.println("Connection terminated."); serialPort.close(); break; } if (joyskoro.isButtonDown(joyskoro.BUTTON2)) { boolean flag = true; //reading from key input from the keyboard System.out.println("Please input a command: "); while (flag) { try { keyinput = System.in.read(); } catch (IOException ioexc) {/*there is no need to put * anything here */ } if((char)keyinput=='w') { pushIt((byte)85); } if((char)keyinput=='s') { pushIt((byte)84); } if((char)keyinput=='a') { pushIt((byte)83); } if((char)keyinput=='d') { pushIt((byte)82); } if((char)keyinput=='q') { pushIt((byte)89); } if((char)keyinput=='\t') { //this stop reading input from the keyboard flag = false; } } and help anyways here is the block of code that throwing an exception for the test program: > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/5c8f7d68/attachment-0022.html From fire_baptized at hotmail.com Fri Apr 25 07:59:53 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 09:59:53 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Are there any examples of how to push out data? As in using input and output streams - if I can compare code maybe I can see where this is causing a problem. I have a byte array that I am pushing out data. I keep getting null pointer exceptions every where I turn. > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/22228ab6/attachment-0021.html From ajmas at sympatico.ca Sat Apr 26 07:37:09 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 26 Apr 2008 09:37:09 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hi, On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote: > > Are there any examples of how to push out data? As in using input > and output streams - if I can compare code maybe I can see where > this is causing a problem. I have a byte array that I am pushing > out data. I keep getting null pointer exceptions every where I turn. > There are some examples here that might be of help: http://rxtx.qbang.org/wiki/index.php/Examples Andre From fire_baptized at hotmail.com Sat Apr 26 20:13:54 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Sat, 26 Apr 2008 22:13:54 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: looked at those....yep didnt help - I need to push out data with GUI and not get a null pointer exception everytime I try. > CC: rxtx at qbang.org> From: ajmas at sympatico.ca> To: fire_baptized at hotmail.com> Subject: Re: [Rxtx] Serial Problems with Gui.....> Date: Sat, 26 Apr 2008 09:37:09 -0400> > Hi,> > > On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote:> >> > Are there any examples of how to push out data? As in using input > > and output streams - if I can compare code maybe I can see where > > this is causing a problem. I have a byte array that I am pushing > > out data. I keep getting null pointer exceptions every where I turn.> >> > There are some examples here that might be of help:> > http://rxtx.qbang.org/wiki/index.php/Examples> > Andre _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080426/09f95b41/attachment-0020.html From michael.erskine at ketech.com Mon Apr 28 02:47:22 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 28 Apr 2008 09:47:22 +0100 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D426EF3CBBC5@no-sv-03.ketech.local> Jesrael D. Summerhill wrote: > looked at those....yep didnt help - I need to push out data with GUI and > not get a null pointer exception everytime I try. So it seems pretty obvious that your code needs to check for nulls wherever one may occur and report what's happening. Alternatively, catch the npe and display the stack trace. Then you can fix your code so it doesn't try to work with something that ain't there. Regards, Michael Erskine. From scldad at sdc.com.au Mon Apr 28 03:58:34 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Mon, 28 Apr 2008 19:28:34 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Message-ID: <200804281928.34454.scldad@sdc.com.au> Has anybody done any design work on this? The first thing that springs to mind is that we still need to check for lock files because other apps tend to use that approach even if we go to ioctl. Cheers, Stephen Davies On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > Thanks Trent. > > Problem is only that I'm really not at all > Familiar with the C part of RXTX. If there > Were anything I could do in Java for this, > It would be easier for me.... > > ... Are there any C experts here on the list > Who'd like to look at ioctl port locking > For linux? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > -----Original Message----- > > From: Trent Jarvi [mailto:tjarvi at qbang.org] > > Sent: Donnerstag, 24. April 2008 04:32 > > To: Oberhuber, Martin > > Cc: rxtx at qbang.org > > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > > > I'm wondering what the status is with RXTX locking > > > serial ports on Linux? > > > > > > My understanding is that the mechanism used in > > > 2.1-7r2 (lockfiles) is not really state of the art, and > > > has lots of problems (e.g. missing permissions). > > > > > > There was an idea to migrate towards a Kernel > > > syscall based solution for port locking. > > > > > > What's the status here? > > > > Hi Martin, > > > > I'm in favor of deprecating the current FHS locking mechanism > > in favor of > > an IOCTL when available. I think it will be available on all the > > platforms but do not know for sure. > > > > The status is unchanged. I've had very few free cycles for > > such things. > > Feel free to take a stab at it if you have some time. I > > believe the IOCTL > > is used in the Mac OS X code already. > > > > I don't see any real backwards compatability issues and the > > IOCTL should > > just work. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Mon Apr 28 04:21:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 28 Apr 2008 04:21:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804281928.34454.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: I don't think there would need to be any architectural changes. A couple ifdefs and minor changes in the current code should be enough. Proposal: FHS/UUCP locks: continue to respect them, try to create them but do not error if the IOCTL is supported. (But does the IOCTL being defined mean it will work?) Enumeration: Do not assert the IOCTL while opening. Serial.open: assert the IOCTL after open. Continue to use locks as described above after asserting the IOCTL. If the IOCTL is defined but not working, handle it here. Failure cases include the IOCTL is not supported and the port is already locked. On Mon, 28 Apr 2008, Stephen Davies wrote: > Has anybody done any design work on this? > The first thing that springs to mind is that we still need to check for lock > files because other apps tend to use that approach even if we go to ioctl. > > Cheers, > Stephen Davies > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: >> Thanks Trent. >> >> Problem is only that I'm really not at all >> Familiar with the C part of RXTX. If there >> Were anything I could do in Java for this, >> It would be easier for me.... >> >> ... Are there any C experts here on the list >> Who'd like to look at ioctl port locking >> For linux? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >>> -----Original Message----- >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] >>> Sent: Donnerstag, 24. April 2008 04:32 >>> To: Oberhuber, Martin >>> Cc: rxtx at qbang.org >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? >>> >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: >>>> Dear RXTX community, >>>> >>>> I'm wondering what the status is with RXTX locking >>>> serial ports on Linux? >>>> >>>> My understanding is that the mechanism used in >>>> 2.1-7r2 (lockfiles) is not really state of the art, and >>>> has lots of problems (e.g. missing permissions). >>>> >>>> There was an idea to migrate towards a Kernel >>>> syscall based solution for port locking. >>>> >>>> What's the status here? >>> >>> Hi Martin, >>> >>> I'm in favor of deprecating the current FHS locking mechanism >>> in favor of >>> an IOCTL when available. I think it will be available on all the >>> platforms but do not know for sure. >>> >>> The status is unchanged. I've had very few free cycles for >>> such things. >>> Feel free to take a stab at it if you have some time. I >>> believe the IOCTL >>> is used in the Mac OS X code already. >>> >>> I don't see any real backwards compatability issues and the >>> IOCTL should >>> just work. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Tue Apr 29 12:04:04 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Apr 2008 20:04:04 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Hi all, The biggest problem that I have seen with lockfiles on Linux At least is, that it seems there is no standard with respect To the folder in which they should be created. Also, many Distributions seem to set up file system permissions in such A way that writing to the lockfile folder is not allowed for The normal user -- that's why we stopped using lockfiles In our commercial product. If we are to still respect lockfiles, we first need to Understand where we are expected to look for them. Does Anybody have any insight what variants of lockfile folder Schema exist out there in the wild? Some apps like minicom Seem to even allow users to manually specify a lockfile Folder of their choice. Because of the difficulty finding the right lockfile folder, And because of the inherent risk of thinking that something Might be locked while it actually isn't, I'd suggest that RXTX should have a "soft-off" feature that allows disabling ALL Lockfile checks at runtime without recompiling the native Sharedlibs. Trent - I like your strategy outline, but I think that it Needs to be configurable by the client such that users and/or Customer Support can disable lockfiles / disable ioctl in Case they detect that they are runing on an OS / Kernal that Does not support one or the other. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Montag, 28. April 2008 12:22 > To: Stephen Davies > Cc: rxtx at qbang.org; Oberhuber, Martin; Trent Jarvi > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > I don't think there would need to be any architectural > changes. A couple > ifdefs and minor changes in the current code should be enough. > > Proposal: > > FHS/UUCP locks: > continue to respect them, try to create them but do not error if > the IOCTL is supported. (But does the IOCTL being defined mean > it will work?) > Enumeration: > Do not assert the IOCTL while opening. > Serial.open: > assert the IOCTL after open. Continue to use locks as described > above after asserting the IOCTL. If the IOCTL is defined but > not working, handle it here. Failure cases include the IOCTL > is not supported and the port is already locked. > > On Mon, 28 Apr 2008, Stephen Davies wrote: > > > Has anybody done any design work on this? > > The first thing that springs to mind is that we still need > to check for lock > > files because other apps tend to use that approach even if > we go to ioctl. > > > > Cheers, > > Stephen Davies > > > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > >> Thanks Trent. > >> > >> Problem is only that I'm really not at all > >> Familiar with the C part of RXTX. If there > >> Were anything I could do in Java for this, > >> It would be easier for me.... > >> > >> ... Are there any C experts here on the list > >> Who'd like to look at ioctl port locking > >> For linux? > >> > >> Thanks, > >> -- > >> Martin Oberhuber, Senior Member of Technical Staff, Wind River > >> Target Management Project Lead, DSDP PMC Member > >> http://www.eclipse.org/dsdp/tm > >> > >>> -----Original Message----- > >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] > >>> Sent: Donnerstag, 24. April 2008 04:32 > >>> To: Oberhuber, Martin > >>> Cc: rxtx at qbang.org > >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? > >>> > >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > >>>> Dear RXTX community, > >>>> > >>>> I'm wondering what the status is with RXTX locking > >>>> serial ports on Linux? > >>>> > >>>> My understanding is that the mechanism used in > >>>> 2.1-7r2 (lockfiles) is not really state of the art, and > >>>> has lots of problems (e.g. missing permissions). > >>>> > >>>> There was an idea to migrate towards a Kernel > >>>> syscall based solution for port locking. > >>>> > >>>> What's the status here? > >>> > >>> Hi Martin, > >>> > >>> I'm in favor of deprecating the current FHS locking mechanism > >>> in favor of > >>> an IOCTL when available. I think it will be available on all the > >>> platforms but do not know for sure. > >>> > >>> The status is unchanged. I've had very few free cycles for > >>> such things. > >>> Feel free to take a stab at it if you have some time. I > >>> believe the IOCTL > >>> is used in the Mac OS X code already. > >>> > >>> I don't see any real backwards compatability issues and the > >>> IOCTL should > >>> just work. > >>> > >>> -- > >>> Trent Jarvi > >>> tjarvi at qbang.org > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > From Steffen.DETTMER at ingenico.com Tue Apr 29 13:34:44 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 29 Apr 2008 21:34:44 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Message-ID: <20080429193444.GU2928@elberon.bln.de.ingenico.com> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > The biggest problem that I have seen with lockfiles on Linux > At least is, that it seems there is no standard with respect > To the folder in which they should be created. Also, many > Distributions seem to set up file system permissions in such > A way that writing to the lockfile folder is not allowed for > The normal user -- that's why we stopped using lockfiles > In our commercial product. It seems it depends on the expectations. I consider it as a feature that by default a linux user cannot access serial ports. Maybe root connected a modem (can produce phone bills) or even some serial card reader, maybe with the web servers key pair. I would expect that by default a user cannot open the serial port because of insufficient permissions on the device file. I would expect this on other unices as well (but I don't know it). For windows I think it should be similar but not impacting so much in practice, because often windows users work with big permissions on a somewhat high priviledge level or even Administrator. > If we are to still respect lockfiles, we first need to > Understand where we are expected to look for them. Does > Anybody have any insight what variants of lockfile folder > Schema exist out there in the wild? Some apps like minicom > Seem to even allow users to manually specify a lockfile > Folder of their choice. At least my (ancient) minicom does not allow the user to change this option, it is displayed but read-only, but root is allowed to change it. > Because of the difficulty finding the right lockfile folder, > And because of the inherent risk of thinking that something > Might be locked while it actually isn't, I'd suggest that > RXTX should have a "soft-off" feature that allows disabling > ALL Lockfile checks at runtime without recompiling the native > Sharedlibs. sounds very reasonable, yes... and as admin I would not wish that users could skip such locking because they do things wrong by default ;) (in the end I guess that is related to the dilemma, that hotplug/user-owned-periphery and multi-user systems simply conflict) > Trent - I like your strategy outline, but I think that it > Needs to be configurable by the client such that users and/or > Customer Support can disable lockfiles / disable ioctl in > Case they detect that they are runing on an OS / Kernal that > Does not support one or the other. Yes, this would be good I guess... Applications could offer configuration options to control that, maybe similarily as minicom. BTW, man minicom tells: *B - Lock file location On most systems This should be /usr/spool/uucp. Linux systems use /var/lock. If this directory does not exist, minicom will not attempt to use lockfiles. The statement `Linux systems use /var/lock' is interesting, does anyone know the source of this convention? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Tue Apr 29 16:11:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Apr 2008 16:11:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? These details are outlined in the Filesystem Hierarchy Standard (FHS). http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLOCKLOCKFILES -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Tue Apr 29 18:58:09 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Wed, 30 Apr 2008 10:28:09 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: <200804301028.09307.scldad@sdc.com.au> I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is the same. Any ideas as to how to handle this? Stephen On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: > * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > > The biggest problem that I have seen with lockfiles on Linux > > At least is, that it seems there is no standard with respect > > To the folder in which they should be created. Also, many > > Distributions seem to set up file system permissions in such > > A way that writing to the lockfile folder is not allowed for > > The normal user -- that's why we stopped using lockfiles > > In our commercial product. > > It seems it depends on the expectations. I consider it as a > feature that by default a linux user cannot access serial ports. > Maybe root connected a modem (can produce phone bills) or even > some serial card reader, maybe with the web servers key pair. > > I would expect that by default a user cannot open the serial port > because of insufficient permissions on the device file. I would > expect this on other unices as well (but I don't know it). > > For windows I think it should be similar but not impacting so > much in practice, because often windows users work with big > permissions on a somewhat high priviledge level or even > Administrator. > > > If we are to still respect lockfiles, we first need to > > Understand where we are expected to look for them. Does > > Anybody have any insight what variants of lockfile folder > > Schema exist out there in the wild? Some apps like minicom > > Seem to even allow users to manually specify a lockfile > > Folder of their choice. > > At least my (ancient) minicom does not allow the user to change > this option, it is displayed but read-only, but root is allowed > to change it. > > > Because of the difficulty finding the right lockfile folder, > > And because of the inherent risk of thinking that something > > Might be locked while it actually isn't, I'd suggest that > > RXTX should have a "soft-off" feature that allows disabling > > ALL Lockfile checks at runtime without recompiling the native > > Sharedlibs. > > sounds very reasonable, yes... > and as admin I would not wish that users could skip such > locking because they do things wrong by default ;) > > (in the end I guess that is related to the dilemma, that > hotplug/user-owned-periphery and multi-user systems simply > conflict) > > > Trent - I like your strategy outline, but I think that it > > Needs to be configurable by the client such that users and/or > > Customer Support can disable lockfiles / disable ioctl in > > Case they detect that they are runing on an OS / Kernal that > > Does not support one or the other. > > Yes, this would be good I guess... Applications could offer > configuration options to control that, maybe similarily as > minicom. > > BTW, man minicom tells: > > *B - Lock file location > On most systems This should be /usr/spool/uucp. > Linux systems use /var/lock. If this directory > does not exist, minicom will not attempt to use > lockfiles. > > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure > and expedient electronic transaction acceptance. Ingenico products leverage > proven technology, established standards and unparalleled ergonomics to > provide optimal reliability, versatility and usability. This comprehensive > range of products is complemented by a global array of services and > partnerships, enabling businesses in a number of vertical sectors to accept > transactions anywhere their business takes them. www.ingenico.com This > message may contain confidential and/or privileged information. If you are > not the addressee or authorized to receive this for the addressee, you must > not use, copy, disclose or take any action based on this message or any > information herein. If you have received this message in error, please > advise the sender immediately by reply e-mail and delete this message. > Thank you for your cooperation. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Wed Apr 30 19:30:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 30 Apr 2008 19:30:51 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804301028.09307.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> <200804301028.09307.scldad@sdc.com.au> Message-ID: Hi Stephen, I suspect ioctl/TIOCEXCL open/O_EXCL would do the job. Mac uses TIOCEXCL and it is POSIX. We use O_EXCL for lockfiles on Linux already. On Wed, 30 Apr 2008, Stephen Davies wrote: > I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is > the same. > > Any ideas as to how to handle this? > > Stephen > > > On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: >> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: >>> The biggest problem that I have seen with lockfiles on Linux >>> At least is, that it seems there is no standard with respect >>> To the folder in which they should be created. Also, many >>> Distributions seem to set up file system permissions in such >>> A way that writing to the lockfile folder is not allowed for >>> The normal user -- that's why we stopped using lockfiles >>> In our commercial product. >> >> It seems it depends on the expectations. I consider it as a >> feature that by default a linux user cannot access serial ports. >> Maybe root connected a modem (can produce phone bills) or even >> some serial card reader, maybe with the web servers key pair. >> >> I would expect that by default a user cannot open the serial port >> because of insufficient permissions on the device file. I would >> expect this on other unices as well (but I don't know it). >> >> For windows I think it should be similar but not impacting so >> much in practice, because often windows users work with big >> permissions on a somewhat high priviledge level or even >> Administrator. >> >>> If we are to still respect lockfiles, we first need to >>> Understand where we are expected to look for them. Does >>> Anybody have any insight what variants of lockfile folder >>> Schema exist out there in the wild? Some apps like minicom >>> Seem to even allow users to manually specify a lockfile >>> Folder of their choice. >> >> At least my (ancient) minicom does not allow the user to change >> this option, it is displayed but read-only, but root is allowed >> to change it. >> >>> Because of the difficulty finding the right lockfile folder, >>> And because of the inherent risk of thinking that something >>> Might be locked while it actually isn't, I'd suggest that >>> RXTX should have a "soft-off" feature that allows disabling >>> ALL Lockfile checks at runtime without recompiling the native >>> Sharedlibs. >> >> sounds very reasonable, yes... >> and as admin I would not wish that users could skip such >> locking because they do things wrong by default ;) >> >> (in the end I guess that is related to the dilemma, that >> hotplug/user-owned-periphery and multi-user systems simply >> conflict) >> >>> Trent - I like your strategy outline, but I think that it >>> Needs to be configurable by the client such that users and/or >>> Customer Support can disable lockfiles / disable ioctl in >>> Case they detect that they are runing on an OS / Kernal that >>> Does not support one or the other. >> >> Yes, this would be good I guess... Applications could offer >> configuration options to control that, maybe similarily as >> minicom. >> >> BTW, man minicom tells: >> >> *B - Lock file location >> On most systems This should be /usr/spool/uucp. >> Linux systems use /var/lock. If this directory >> does not exist, minicom will not attempt to use >> lockfiles. >> >> The statement `Linux systems use /var/lock' is interesting, does >> anyone know the source of this convention? >> >> oki, >> >> Steffen >> >> About Ingenico Throughout the world businesses rely on Ingenico for secure >> and expedient electronic transaction acceptance. Ingenico products leverage >> proven technology, established standards and unparalleled ergonomics to >> provide optimal reliability, versatility and usability. This comprehensive >> range of products is complemented by a global array of services and >> partnerships, enabling businesses in a number of vertical sectors to accept >> transactions anywhere their business takes them. www.ingenico.com This >> message may contain confidential and/or privileged information. If you are >> not the addressee or authorized to receive this for the addressee, you must >> not use, copy, disclose or take any action based on this message or any >> information herein. If you have received this message in error, please >> advise the sender immediately by reply e-mail and delete this message. >> Thank you for your cooperation. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0046.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0044.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0031.html From pboulton at pulsetracer.com Fri Apr 18 14:30:13 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Fri, 18 Apr 2008 13:30:13 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site Message-ID: <480904D5.1060307@pulsetracer.com> Hello, gentle serial porters. I have downloaded the zipped up binaries for use on Windows without Sun's CommAPI, but don't seem able to extract anything from the download. Go to main page, http://www.rxtx.org/ Click on Downloads I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) And I save it to disk. If I try and extract the files with WinZip, Winzip thinks the archive is corrupt. If I try using Windows Explorer, I am able to extract it into a single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than the original .zip. Any help would be much appreciated. Sincerely, Philip Boulton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080418/97d89793/attachment-0029.html From tjarvi at qbang.org Fri Apr 18 19:07:00 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 18 Apr 2008 19:07:00 -0600 (MDT) Subject: [Rxtx] Difficulty opening zip file at rxtx site In-Reply-To: <480904D5.1060307@pulsetracer.com> References: <480904D5.1060307@pulsetracer.com> Message-ID: On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org From pboulton at pulsetracer.com Sat Apr 19 12:46:26 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Sat, 19 Apr 2008 11:46:26 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site References: <480904D5.1060307@pulsetracer.com> Message-ID: <53DB7576450695419E09299104043761A78533@ZTGSERVER.ztg.local> I have been able to get my hands on the binaries, by going to the ftp directory /pub/rxtx at ftp.qbang.org,, and ftping the file rxtx-2.1-7-bins-r2.zip . This opens happily with Winzip, and extracts as the set of files that you describe below. I only experience the ill-formed archive problem by clicking the link on the rxtx.org Downloads page (http://rxtx.qbang.org/pub/rxtx/ rxtx-2.1-7-bins-r2.zip ). Not sure what to make of that. Philip Boulton ________________________________ From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Fri 4/18/2008 6:07 PM To: Philip Boulton Cc: rxtx at qbang.org Subject: Re: [Rxtx] Difficulty opening zip file at rxtx site On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080419/147923bb/attachment-0028.html From jlar310 at gmail.com Sat Apr 19 19:11:55 2008 From: jlar310 at gmail.com (Jeff Larsen) Date: Sat, 19 Apr 2008 20:11:55 -0500 Subject: [Rxtx] Moxa serial over Ethernet driver Message-ID: Hi all, I've been using javax.comm for years to communicate with a legacy radio data system. We want to migrate the java side of the system to a VMware Server virtual machine. We've had great success using Moxa DE-303 and 5610 serial over Ethernet appliances and virtual machines for running hylafax. The OS (Linux in this case) uses a kernel driver to communicate with the Moxa via a virtual serial port such as /dev/ttyr00. I want to do the same thing with javax.comm or gnu.io to connect to a virtual serial port. However I'm hitting road blocks everywhere. javax.comm for Linux sees the virtual port, but there are transmission errors. Tried Solaris too, but the Solaris Moxa drivers don't play nice with javax.comm because the driver uses /dev/pts/n instead of /dev/term/x. Next I tried RXTX on Linux, but I'm getting NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX on Solaris. Has anyone used RXTX with serial over Ethernet devices? Any hints on how to make it work? I know that I'm not completely off track because javax.comm does work with Moxa on a Windows platform, but that's just not an option for production deployment. -- Jeff From tjarvi at qbang.org Sat Apr 19 21:08:41 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 19 Apr 2008 21:08:41 -0600 (MDT) Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: yOn Sat, 19 Apr 2008, Jeff Larsen wrote: > Hi all, > > I've been using javax.comm for years to communicate with a legacy > radio data system. We want to migrate the java side of the system to a > VMware Server virtual machine. We've had great success using Moxa > DE-303 and 5610 serial over Ethernet appliances and virtual machines > for running hylafax. The OS (Linux in this case) uses a kernel driver > to communicate with the Moxa via a virtual serial port such as > /dev/ttyr00. > > I want to do the same thing with javax.comm or gnu.io to connect to a > virtual serial port. However I'm hitting road blocks everywhere. > javax.comm for Linux sees the virtual port, but there are transmission > errors. Tried Solaris too, but the Solaris Moxa drivers don't play > nice with javax.comm because the driver uses /dev/pts/n instead of > /dev/term/x. Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris. > > Has anyone used RXTX with serial over Ethernet devices? Any hints on > how to make it work? > > I know that I'm not completely off track because javax.comm does work > with Moxa on a Windows platform, but that's just not an option for > production deployment. > > Moxa should work under linux. There may be minor issues depending upon how complete the kernel driver is but I think it will work. One of the minor issues is /dev/ttyr00 is not enumerated. There are several work arounds documented with the source code and on the wiki. The easiest solution for testing purposes is to make a symbolic link from /dev/ttyr00 to a port that is enumerated such as /dev/ttyS129. You can later alter the rxtx source or use properties to change the enumerated ports. -- Trent Jarvi tjarvi at qbang.org From d.tonhofer at m-plify.com Sun Apr 20 03:33:30 2008 From: d.tonhofer at m-plify.com (David Tonhofer (M-PLIFY S.A.)) Date: Sun, 20 Apr 2008 11:33:30 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: <480B0DEA.5010908@m-plify.com> Jeff Larsen wrote: > Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris It might be that the Java side of RXTX does not recognize that portname. Trying modifying src/RXTXCommDriver.java as described in this case: http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card From ajmas at sympatico.ca Sun Apr 20 16:37:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Apr 2008 18:37:59 -0400 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <480B0DEA.5010908@m-plify.com> References: <480B0DEA.5010908@m-plify.com> Message-ID: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > Jeff Larsen wrote: >> Next I tried RXTX on Linux, but I'm getting >> NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX >> on Solaris > It might be that the Java side of RXTX does not recognize that > portname. > Trying modifying src/RXTXCommDriver.java as described in this case: > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card I wonder whether it would be worth allowing custom port prefixes as a system parameter? For example: gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" Andre From Martin.Oberhuber at windriver.com Tue Apr 22 12:34:36 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 22 Apr 2008 20:34:36 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> References: <480B0DEA.5010908@m-plify.com> <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE6485848056CD6CE@ism-mail03.corp.ad.wrs.com> Sounds like a great idea... I'm wondering how the "variable part" after the Prefixes could be specified though? What about allowing Regular Expression character Classes in the existing System Property for specifying ports: System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyS[0-9],ttyS[ABC],ttyUSB[0-9a-z]"); The set of allowed patterns would of course need to Be restricted compared to REGEX, because it must be A syntax that supports iterating over it. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Montag, 21. April 2008 00:38 > To: rxtx at qbang.org and Users > Subject: Re: [Rxtx] Moxa serial over Ethernet driver > > > On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > > Jeff Larsen wrote: > >> Next I tried RXTX on Linux, but I'm getting > >> NoSuchPortException connecting to /dev/ttyr00. I have yet > to try RXTX > >> on Solaris > > It might be that the Java side of RXTX does not recognize that > > portname. > > Trying modifying src/RXTXCommDriver.java as described in this case: > > > > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_ > SST-4P.2FLP_multiport_card > > I wonder whether it would be worth allowing custom port > prefixes as a > system parameter? For > example: > > gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Loi.TRAN at weatherford.com Tue Apr 22 13:10:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Tue, 22 Apr 2008 14:10:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled Message-ID: Hi, I'm currently using the Java RXTX API to interface to a serial port. The serial port is connected to a bridge board that communicates with our communications system running at 1.875 Mbps which is linked to an embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no flow control). I send a command to the embedded board through the serial-bridge board which then is relayed to the embedded board. The command sent asks the embedded board to dump a binary image. Here's where I'm hitting some problems. I've successfully done this is an integrated serial port from the laptop. The binary file that comes back is consistent on every attempt. When I use the application I've written to do the same thing with a USB-to-serial adapter, the image I get back is not the same as the image I receive through the USB-to-serial adapter is not consistent at all. A final thing is that when I use a terminal program to dump the binary image with the USB-serial adapter, the image is correct. Every time! What is the terminal program doing that's not being done in my application? My application is quite simple. Has anyone observed this behavior before? If you have, I'd like to know how you've gotten around this problem. Thanks, LT =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From tjarvi at qbang.org Tue Apr 22 21:11:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 22 Apr 2008 21:11:10 -0600 (MDT) Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org From Loi.TRAN at weatherford.com Wed Apr 23 08:35:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Wed, 23 Apr 2008 09:35:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: Thanks for all the responses. I finally tried something that worked consistently. I updated my Prolific driver and repeated my tests. It worked. If you're using the Prolific type USB-serial adapters, do no use the Prolific version 2.0.2.1 driver on Windows. Update it to the latest 2.0.2.8 version. Again, thanks for all the responses. LT -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Tuesday, April 22, 2008 10:11 PM To: TRAN, Loi X. Cc: rxtx at qbang.org Subject: Re: [Rxtx] Prolific USB - RXTX data mangled On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From Martin.Oberhuber at windriver.com Wed Apr 23 18:54:26 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 02:54:26 +0200 Subject: [Rxtx] RXTX port locking on Linux status? Message-ID: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Dear RXTX community, I'm wondering what the status is with RXTX locking serial ports on Linux? My understanding is that the mechanism used in 2.1-7r2 (lockfiles) is not really state of the art, and has lots of problems (e.g. missing permissions). There was an idea to migrate towards a Kernel syscall based solution for port locking. What's the status here? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/9878db9f/attachment-0024.html From tjarvi at qbang.org Wed Apr 23 20:32:24 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Apr 2008 20:32:24 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > Dear RXTX community, > > I'm wondering what the status is with RXTX locking > serial ports on Linux? > > My understanding is that the mechanism used in > 2.1-7r2 (lockfiles) is not really state of the art, and > has lots of problems (e.g. missing permissions). > > There was an idea to migrate towards a Kernel > syscall based solution for port locking. > > What's the status here? > Hi Martin, I'm in favor of deprecating the current FHS locking mechanism in favor of an IOCTL when available. I think it will be available on all the platforms but do not know for sure. The status is unchanged. I've had very few free cycles for such things. Feel free to take a stab at it if you have some time. I believe the IOCTL is used in the Mac OS X code already. I don't see any real backwards compatability issues and the IOCTL should just work. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Apr 24 06:14:06 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 14:14:06 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Thanks Trent. Problem is only that I'm really not at all Familiar with the C part of RXTX. If there Were anything I could do in Java for this, It would be easier for me.... ... Are there any C experts here on the list Who'd like to look at ioctl port locking For linux? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Donnerstag, 24. April 2008 04:32 > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > I'm wondering what the status is with RXTX locking > > serial ports on Linux? > > > > My understanding is that the mechanism used in > > 2.1-7r2 (lockfiles) is not really state of the art, and > > has lots of problems (e.g. missing permissions). > > > > There was an idea to migrate towards a Kernel > > syscall based solution for port locking. > > > > What's the status here? > > > > Hi Martin, > > I'm in favor of deprecating the current FHS locking mechanism > in favor of > an IOCTL when available. I think it will be available on all the > platforms but do not know for sure. > > The status is unchanged. I've had very few free cycles for > such things. > Feel free to take a stab at it if you have some time. I > believe the IOCTL > is used in the Mac OS X code already. > > I don't see any real backwards compatability issues and the > IOCTL should > just work. > > -- > Trent Jarvi > tjarvi at qbang.org > From sspies at sloc.de Thu Apr 24 07:15:36 2008 From: sspies at sloc.de (Sebastian Spies) Date: Thu, 24 Apr 2008 15:15:36 +0200 (CEST) Subject: [Rxtx] rxtx on gumstix: Interrupted system call In-Reply-To: <47FB7B20.7080504@sloc.de> References: <47FB7B20.7080504@sloc.de> Message-ID: <55445.130.83.139.205.1209042936.squirrel@ssl.sloc.de> Dear list, while porting rxtx to the gumstix, I found out, that select used in readArray in SerialImp.c might not work as expected. Maybe, because of missing TIOCSERGETLSR-support? select is often interrupted, so i wrote the following quick'n'dirty hack to make it work on gumstix: diff -Nur rxtx-2.1-7r2/src/SerialImp.c rxtx-2.1-7r2/src/SerialImp.c --- rxtx-2.1-7r2/src/SerialImp.c 2006-01-29 23:19:04.000000000 +0100 +++ rxtx-2.1-7r2-patched/src/SerialImp.c 2008-04-24 14:30:17.000000000 +0200 @@ -3380,7 +3381,7 @@ JNIEXPORT jint JNICALL RXTXPort(readArray)( JNIEnv *env, jobject jobj, jbyteArray jbarray, jint offset, jint length ) { - int bytes; + int bytes = 0; jbyte *body; /* char msg[80]; */ int fd = get_java_var( env, jobj, "fd", "I" ); @@ -3397,9 +3398,18 @@ "readArray", "Invalid length" ); return -1; } - body = (*env)->GetByteArrayElements( env, jbarray, 0 ); - bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ - (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + while(1 > bytes) + { + body = (*env)->GetByteArrayElements( env, jbarray, 0 ); + bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ + (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + // quick'n'dirty - SSP + report (" trying again... \n"); + errno = 0; + } + if( bytes < 0 ) { report( "RXTXPort:readArray bytes < 0" ); LEAVE( "RXTXPort:readArray" ); > Hey, > > I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use > RXTXPort$SerialInputStream.read(), then I get the following Exception. I > did not yet figure out which system call is interrupted as strace > produces loads of output. > > Any help would be very appreciated. Thanks in advance. > Sebastian > > > [java] java.io.IOException: Interrupted system call in readArray > [java] at gnu.io.RXTXPort.readArray(Native Method) > [java] at > gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) > [java] at > java.io.FilterInputStream.read(FilterInputStream.java:189) > [java] at > java.io.BufferedInputStream.refill(BufferedInputStream.java:371) > [java] at > java.io.BufferedInputStream.read(BufferedInputStream.java:229) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) > [java] at > com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) > > -- > Sebastian Spies > > mail: sspies at sloc.de > > > > From fire_baptized at hotmail.com Thu Apr 24 18:27:48 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Thu, 24 Apr 2008 20:27:48 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hello I am having a problem with the serial device connecting (software wise) to the serial port. However I have a test program and it seems to work just fine in that environment - and it doesnt use GUI. The error I am getting is : PortNotFoundException Now the way I have it setup in the GUI environment is that once the user pushes a JButton the program connects using this class: protected void establishConnection() { try { portId = CommPortIdentifier.getPortIdentifier("COM3"); System.out.println("Establishing connction....."); messages[0] = "\nEstablishing connction.....\n"; } catch ( NoSuchPortException noport) { System.out.println("Port not found: "+ noport); messages[0] = "Port not found: "+ noport+"\n"; } try { serialPort = (SerialPort) portId.open("serial", 50); System.out.println("Port has been found."); messages[1] = "Port has been found.\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[1] = "" +usedport; } try { serialPort = (SerialPort) portId.open("serial", 50); messages[2] = "Connecting to COM3 on port 50....\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; } try { serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); System.out.println("Esablishing the transfer rate settings for COM3."); messages[3] = "Esablishing the transfer rate settings for COM3.\n"; } catch (UnsupportedCommOperationException nosupcom) { System.out.println(nosupcom); System.out.println("The tranfer rate could not be esblished on COM3."); messages[3] = "The tranfer rate could not be esblished on COM3.\n"; } System.out.println(serialPort.getFlowControlMode()); messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; //sendDataOut(buffer[3],buffer[4]); } I need all the data in this method (and all the string values in this method) to be printed out on a JTextArea. I wont do me any good if not all the text is printed on a JTextArea in another class. So I have the text printing the JTextArea correctly, but everytime the JButton is activated - it gives me that error message. I did add a disconnect button that is supposed to call the serialPort.close(). _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/273fd4ec/attachment-0023.html From tjarvi at qbang.org Thu Apr 24 21:54:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Apr 2008 21:54:10 -0600 (MDT) Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > Hello I am having a problem with the serial device connecting (software > wise) to the serial port. However I have a test program and it seems to > work just fine in that environment - and it doesnt use GUI. The error I > am getting is : PortNotFoundException Now the way I have it setup in the > GUI environment is that once the user pushes a JButton the program > connects using this class: > > protected void establishConnection() { > try { > portId = CommPortIdentifier.getPortIdentifier("COM3"); > System.out.println("Establishing connction....."); > messages[0] = "\nEstablishing connction.....\n"; > } > catch ( NoSuchPortException noport) { > System.out.println("Port not found: "+ noport); > messages[0] = "Port not found: "+ noport+"\n"; > } > try { > serialPort = (SerialPort) portId.open("serial", 50); > System.out.println("Port has been found."); > messages[1] = "Port has been found.\n"; > } > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[1] = "" +usedport; > } ================================================================= > try { > serialPort = (SerialPort) portId.open("serial", 50); > messages[2] = "Connecting to COM3 on port 50....\n"; > } ================================================================== > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > } > try { > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > System.out.println("Esablishing the transfer rate settings for COM3."); > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > } > catch (UnsupportedCommOperationException nosupcom) { > System.out.println(nosupcom); > System.out.println("The tranfer rate could not be esblished on COM3."); > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > } > System.out.println(serialPort.getFlowControlMode()); > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > //sendDataOut(buffer[3],buffer[4]); > } > > I need all the data in this method (and all the string values in this > method) to be printed out on a JTextArea. I wont do me any good if not > all the text is printed on a JTextArea in another class. So I have the > text printing the JTextArea correctly, but everytime the JButton is > activated - it gives me that error message. I did add a disconnect > button that is supposed to call the serialPort.close(). > The open code used twice is going to throw an exception. It may be that you catch the exception above this code and print a confusing message? A common mistake is people will accidently run two copies of their program. The first instance of the program will open the port and prevent enumeration (finding the port) in the second instance of the program. As an example, you may be running your text based application which is preventing the GUI from seeing the port. Enumeration is done by trying to open the port. If the port is open, Enumeration fails. -- Trent Jarvi tjarvi at qbang.org From fire_baptized at hotmail.com Thu Apr 24 22:32:05 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 00:32:05 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Wow - thanks dude what a dumb thing for me to not catch..... now here is the current problem - right now I am trying to output data again one is with the test program - and it seems that serialPort.setRTS(true); is throwing an exceptions there - now if I show this code please bare in mind that I am only testing - the code is kinda sloppy in my mind - but if I can figure out why calling this function is throwing an exception then maybe I can figure out why my GUI application is getting the same null pointer exceptions when try to send out the data stream. FYI Trent this email is not directed towards you - anyone can jump in on this public static void main(String args[]) { byte[] b = new byte[64]; int keyinput = 0 ; byte x = 0; byte y = 0; PortTesting1 testports = new PortTesting1(); try { joyskoro = Joystick.createInstance(); } catch (IOException ioexc) { System.out.println("There is an input/output problem: " + ioexc); } while (true) { joyskoro.poll(); b[0] = ((byte) -(10 * joyskoro.getY())); b[1] = ((byte) (10 * joyskoro.getX())); System.out.println("The 3rd byte is: " +b[0]); System.out.println("The 4rd byte is: " +b[1]); serialPort.setRTS(true); // HERE IS WHERE THE PROBLEM IS !!!!!!! ON THIS LINE but if I dont have it active in my program the Bluetooth device (that is System.out.println("Ready to send :-) !"); //connected to the serial port does not send out data!!!!! if (joyskoro.isButtonDown(joyskoro.BUTTON10)) { System.out.println("Connection terminated."); serialPort.close(); break; } if (joyskoro.isButtonDown(joyskoro.BUTTON2)) { boolean flag = true; //reading from key input from the keyboard System.out.println("Please input a command: "); while (flag) { try { keyinput = System.in.read(); } catch (IOException ioexc) {/*there is no need to put * anything here */ } if((char)keyinput=='w') { pushIt((byte)85); } if((char)keyinput=='s') { pushIt((byte)84); } if((char)keyinput=='a') { pushIt((byte)83); } if((char)keyinput=='d') { pushIt((byte)82); } if((char)keyinput=='q') { pushIt((byte)89); } if((char)keyinput=='\t') { //this stop reading input from the keyboard flag = false; } } and help anyways here is the block of code that throwing an exception for the test program: > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/5c8f7d68/attachment-0023.html From fire_baptized at hotmail.com Fri Apr 25 07:59:53 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 09:59:53 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Are there any examples of how to push out data? As in using input and output streams - if I can compare code maybe I can see where this is causing a problem. I have a byte array that I am pushing out data. I keep getting null pointer exceptions every where I turn. > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/22228ab6/attachment-0022.html From ajmas at sympatico.ca Sat Apr 26 07:37:09 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 26 Apr 2008 09:37:09 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hi, On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote: > > Are there any examples of how to push out data? As in using input > and output streams - if I can compare code maybe I can see where > this is causing a problem. I have a byte array that I am pushing > out data. I keep getting null pointer exceptions every where I turn. > There are some examples here that might be of help: http://rxtx.qbang.org/wiki/index.php/Examples Andre From fire_baptized at hotmail.com Sat Apr 26 20:13:54 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Sat, 26 Apr 2008 22:13:54 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: looked at those....yep didnt help - I need to push out data with GUI and not get a null pointer exception everytime I try. > CC: rxtx at qbang.org> From: ajmas at sympatico.ca> To: fire_baptized at hotmail.com> Subject: Re: [Rxtx] Serial Problems with Gui.....> Date: Sat, 26 Apr 2008 09:37:09 -0400> > Hi,> > > On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote:> >> > Are there any examples of how to push out data? As in using input > > and output streams - if I can compare code maybe I can see where > > this is causing a problem. I have a byte array that I am pushing > > out data. I keep getting null pointer exceptions every where I turn.> >> > There are some examples here that might be of help:> > http://rxtx.qbang.org/wiki/index.php/Examples> > Andre _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080426/09f95b41/attachment-0021.html From michael.erskine at ketech.com Mon Apr 28 02:47:22 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 28 Apr 2008 09:47:22 +0100 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D426EF3CBBC5@no-sv-03.ketech.local> Jesrael D. Summerhill wrote: > looked at those....yep didnt help - I need to push out data with GUI and > not get a null pointer exception everytime I try. So it seems pretty obvious that your code needs to check for nulls wherever one may occur and report what's happening. Alternatively, catch the npe and display the stack trace. Then you can fix your code so it doesn't try to work with something that ain't there. Regards, Michael Erskine. From scldad at sdc.com.au Mon Apr 28 03:58:34 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Mon, 28 Apr 2008 19:28:34 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Message-ID: <200804281928.34454.scldad@sdc.com.au> Has anybody done any design work on this? The first thing that springs to mind is that we still need to check for lock files because other apps tend to use that approach even if we go to ioctl. Cheers, Stephen Davies On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > Thanks Trent. > > Problem is only that I'm really not at all > Familiar with the C part of RXTX. If there > Were anything I could do in Java for this, > It would be easier for me.... > > ... Are there any C experts here on the list > Who'd like to look at ioctl port locking > For linux? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > -----Original Message----- > > From: Trent Jarvi [mailto:tjarvi at qbang.org] > > Sent: Donnerstag, 24. April 2008 04:32 > > To: Oberhuber, Martin > > Cc: rxtx at qbang.org > > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > > > I'm wondering what the status is with RXTX locking > > > serial ports on Linux? > > > > > > My understanding is that the mechanism used in > > > 2.1-7r2 (lockfiles) is not really state of the art, and > > > has lots of problems (e.g. missing permissions). > > > > > > There was an idea to migrate towards a Kernel > > > syscall based solution for port locking. > > > > > > What's the status here? > > > > Hi Martin, > > > > I'm in favor of deprecating the current FHS locking mechanism > > in favor of > > an IOCTL when available. I think it will be available on all the > > platforms but do not know for sure. > > > > The status is unchanged. I've had very few free cycles for > > such things. > > Feel free to take a stab at it if you have some time. I > > believe the IOCTL > > is used in the Mac OS X code already. > > > > I don't see any real backwards compatability issues and the > > IOCTL should > > just work. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Mon Apr 28 04:21:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 28 Apr 2008 04:21:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804281928.34454.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: I don't think there would need to be any architectural changes. A couple ifdefs and minor changes in the current code should be enough. Proposal: FHS/UUCP locks: continue to respect them, try to create them but do not error if the IOCTL is supported. (But does the IOCTL being defined mean it will work?) Enumeration: Do not assert the IOCTL while opening. Serial.open: assert the IOCTL after open. Continue to use locks as described above after asserting the IOCTL. If the IOCTL is defined but not working, handle it here. Failure cases include the IOCTL is not supported and the port is already locked. On Mon, 28 Apr 2008, Stephen Davies wrote: > Has anybody done any design work on this? > The first thing that springs to mind is that we still need to check for lock > files because other apps tend to use that approach even if we go to ioctl. > > Cheers, > Stephen Davies > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: >> Thanks Trent. >> >> Problem is only that I'm really not at all >> Familiar with the C part of RXTX. If there >> Were anything I could do in Java for this, >> It would be easier for me.... >> >> ... Are there any C experts here on the list >> Who'd like to look at ioctl port locking >> For linux? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >>> -----Original Message----- >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] >>> Sent: Donnerstag, 24. April 2008 04:32 >>> To: Oberhuber, Martin >>> Cc: rxtx at qbang.org >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? >>> >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: >>>> Dear RXTX community, >>>> >>>> I'm wondering what the status is with RXTX locking >>>> serial ports on Linux? >>>> >>>> My understanding is that the mechanism used in >>>> 2.1-7r2 (lockfiles) is not really state of the art, and >>>> has lots of problems (e.g. missing permissions). >>>> >>>> There was an idea to migrate towards a Kernel >>>> syscall based solution for port locking. >>>> >>>> What's the status here? >>> >>> Hi Martin, >>> >>> I'm in favor of deprecating the current FHS locking mechanism >>> in favor of >>> an IOCTL when available. I think it will be available on all the >>> platforms but do not know for sure. >>> >>> The status is unchanged. I've had very few free cycles for >>> such things. >>> Feel free to take a stab at it if you have some time. I >>> believe the IOCTL >>> is used in the Mac OS X code already. >>> >>> I don't see any real backwards compatability issues and the >>> IOCTL should >>> just work. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Tue Apr 29 12:04:04 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Apr 2008 20:04:04 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Hi all, The biggest problem that I have seen with lockfiles on Linux At least is, that it seems there is no standard with respect To the folder in which they should be created. Also, many Distributions seem to set up file system permissions in such A way that writing to the lockfile folder is not allowed for The normal user -- that's why we stopped using lockfiles In our commercial product. If we are to still respect lockfiles, we first need to Understand where we are expected to look for them. Does Anybody have any insight what variants of lockfile folder Schema exist out there in the wild? Some apps like minicom Seem to even allow users to manually specify a lockfile Folder of their choice. Because of the difficulty finding the right lockfile folder, And because of the inherent risk of thinking that something Might be locked while it actually isn't, I'd suggest that RXTX should have a "soft-off" feature that allows disabling ALL Lockfile checks at runtime without recompiling the native Sharedlibs. Trent - I like your strategy outline, but I think that it Needs to be configurable by the client such that users and/or Customer Support can disable lockfiles / disable ioctl in Case they detect that they are runing on an OS / Kernal that Does not support one or the other. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Montag, 28. April 2008 12:22 > To: Stephen Davies > Cc: rxtx at qbang.org; Oberhuber, Martin; Trent Jarvi > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > I don't think there would need to be any architectural > changes. A couple > ifdefs and minor changes in the current code should be enough. > > Proposal: > > FHS/UUCP locks: > continue to respect them, try to create them but do not error if > the IOCTL is supported. (But does the IOCTL being defined mean > it will work?) > Enumeration: > Do not assert the IOCTL while opening. > Serial.open: > assert the IOCTL after open. Continue to use locks as described > above after asserting the IOCTL. If the IOCTL is defined but > not working, handle it here. Failure cases include the IOCTL > is not supported and the port is already locked. > > On Mon, 28 Apr 2008, Stephen Davies wrote: > > > Has anybody done any design work on this? > > The first thing that springs to mind is that we still need > to check for lock > > files because other apps tend to use that approach even if > we go to ioctl. > > > > Cheers, > > Stephen Davies > > > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > >> Thanks Trent. > >> > >> Problem is only that I'm really not at all > >> Familiar with the C part of RXTX. If there > >> Were anything I could do in Java for this, > >> It would be easier for me.... > >> > >> ... Are there any C experts here on the list > >> Who'd like to look at ioctl port locking > >> For linux? > >> > >> Thanks, > >> -- > >> Martin Oberhuber, Senior Member of Technical Staff, Wind River > >> Target Management Project Lead, DSDP PMC Member > >> http://www.eclipse.org/dsdp/tm > >> > >>> -----Original Message----- > >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] > >>> Sent: Donnerstag, 24. April 2008 04:32 > >>> To: Oberhuber, Martin > >>> Cc: rxtx at qbang.org > >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? > >>> > >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > >>>> Dear RXTX community, > >>>> > >>>> I'm wondering what the status is with RXTX locking > >>>> serial ports on Linux? > >>>> > >>>> My understanding is that the mechanism used in > >>>> 2.1-7r2 (lockfiles) is not really state of the art, and > >>>> has lots of problems (e.g. missing permissions). > >>>> > >>>> There was an idea to migrate towards a Kernel > >>>> syscall based solution for port locking. > >>>> > >>>> What's the status here? > >>> > >>> Hi Martin, > >>> > >>> I'm in favor of deprecating the current FHS locking mechanism > >>> in favor of > >>> an IOCTL when available. I think it will be available on all the > >>> platforms but do not know for sure. > >>> > >>> The status is unchanged. I've had very few free cycles for > >>> such things. > >>> Feel free to take a stab at it if you have some time. I > >>> believe the IOCTL > >>> is used in the Mac OS X code already. > >>> > >>> I don't see any real backwards compatability issues and the > >>> IOCTL should > >>> just work. > >>> > >>> -- > >>> Trent Jarvi > >>> tjarvi at qbang.org > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > From Steffen.DETTMER at ingenico.com Tue Apr 29 13:34:44 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 29 Apr 2008 21:34:44 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Message-ID: <20080429193444.GU2928@elberon.bln.de.ingenico.com> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > The biggest problem that I have seen with lockfiles on Linux > At least is, that it seems there is no standard with respect > To the folder in which they should be created. Also, many > Distributions seem to set up file system permissions in such > A way that writing to the lockfile folder is not allowed for > The normal user -- that's why we stopped using lockfiles > In our commercial product. It seems it depends on the expectations. I consider it as a feature that by default a linux user cannot access serial ports. Maybe root connected a modem (can produce phone bills) or even some serial card reader, maybe with the web servers key pair. I would expect that by default a user cannot open the serial port because of insufficient permissions on the device file. I would expect this on other unices as well (but I don't know it). For windows I think it should be similar but not impacting so much in practice, because often windows users work with big permissions on a somewhat high priviledge level or even Administrator. > If we are to still respect lockfiles, we first need to > Understand where we are expected to look for them. Does > Anybody have any insight what variants of lockfile folder > Schema exist out there in the wild? Some apps like minicom > Seem to even allow users to manually specify a lockfile > Folder of their choice. At least my (ancient) minicom does not allow the user to change this option, it is displayed but read-only, but root is allowed to change it. > Because of the difficulty finding the right lockfile folder, > And because of the inherent risk of thinking that something > Might be locked while it actually isn't, I'd suggest that > RXTX should have a "soft-off" feature that allows disabling > ALL Lockfile checks at runtime without recompiling the native > Sharedlibs. sounds very reasonable, yes... and as admin I would not wish that users could skip such locking because they do things wrong by default ;) (in the end I guess that is related to the dilemma, that hotplug/user-owned-periphery and multi-user systems simply conflict) > Trent - I like your strategy outline, but I think that it > Needs to be configurable by the client such that users and/or > Customer Support can disable lockfiles / disable ioctl in > Case they detect that they are runing on an OS / Kernal that > Does not support one or the other. Yes, this would be good I guess... Applications could offer configuration options to control that, maybe similarily as minicom. BTW, man minicom tells: *B - Lock file location On most systems This should be /usr/spool/uucp. Linux systems use /var/lock. If this directory does not exist, minicom will not attempt to use lockfiles. The statement `Linux systems use /var/lock' is interesting, does anyone know the source of this convention? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Tue Apr 29 16:11:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Apr 2008 16:11:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? These details are outlined in the Filesystem Hierarchy Standard (FHS). http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLOCKLOCKFILES -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Tue Apr 29 18:58:09 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Wed, 30 Apr 2008 10:28:09 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: <200804301028.09307.scldad@sdc.com.au> I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is the same. Any ideas as to how to handle this? Stephen On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: > * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > > The biggest problem that I have seen with lockfiles on Linux > > At least is, that it seems there is no standard with respect > > To the folder in which they should be created. Also, many > > Distributions seem to set up file system permissions in such > > A way that writing to the lockfile folder is not allowed for > > The normal user -- that's why we stopped using lockfiles > > In our commercial product. > > It seems it depends on the expectations. I consider it as a > feature that by default a linux user cannot access serial ports. > Maybe root connected a modem (can produce phone bills) or even > some serial card reader, maybe with the web servers key pair. > > I would expect that by default a user cannot open the serial port > because of insufficient permissions on the device file. I would > expect this on other unices as well (but I don't know it). > > For windows I think it should be similar but not impacting so > much in practice, because often windows users work with big > permissions on a somewhat high priviledge level or even > Administrator. > > > If we are to still respect lockfiles, we first need to > > Understand where we are expected to look for them. Does > > Anybody have any insight what variants of lockfile folder > > Schema exist out there in the wild? Some apps like minicom > > Seem to even allow users to manually specify a lockfile > > Folder of their choice. > > At least my (ancient) minicom does not allow the user to change > this option, it is displayed but read-only, but root is allowed > to change it. > > > Because of the difficulty finding the right lockfile folder, > > And because of the inherent risk of thinking that something > > Might be locked while it actually isn't, I'd suggest that > > RXTX should have a "soft-off" feature that allows disabling > > ALL Lockfile checks at runtime without recompiling the native > > Sharedlibs. > > sounds very reasonable, yes... > and as admin I would not wish that users could skip such > locking because they do things wrong by default ;) > > (in the end I guess that is related to the dilemma, that > hotplug/user-owned-periphery and multi-user systems simply > conflict) > > > Trent - I like your strategy outline, but I think that it > > Needs to be configurable by the client such that users and/or > > Customer Support can disable lockfiles / disable ioctl in > > Case they detect that they are runing on an OS / Kernal that > > Does not support one or the other. > > Yes, this would be good I guess... Applications could offer > configuration options to control that, maybe similarily as > minicom. > > BTW, man minicom tells: > > *B - Lock file location > On most systems This should be /usr/spool/uucp. > Linux systems use /var/lock. If this directory > does not exist, minicom will not attempt to use > lockfiles. > > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure > and expedient electronic transaction acceptance. Ingenico products leverage > proven technology, established standards and unparalleled ergonomics to > provide optimal reliability, versatility and usability. This comprehensive > range of products is complemented by a global array of services and > partnerships, enabling businesses in a number of vertical sectors to accept > transactions anywhere their business takes them. www.ingenico.com This > message may contain confidential and/or privileged information. If you are > not the addressee or authorized to receive this for the addressee, you must > not use, copy, disclose or take any action based on this message or any > information herein. If you have received this message in error, please > advise the sender immediately by reply e-mail and delete this message. > Thank you for your cooperation. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Wed Apr 30 19:30:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 30 Apr 2008 19:30:51 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804301028.09307.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> <200804301028.09307.scldad@sdc.com.au> Message-ID: Hi Stephen, I suspect ioctl/TIOCEXCL open/O_EXCL would do the job. Mac uses TIOCEXCL and it is POSIX. We use O_EXCL for lockfiles on Linux already. On Wed, 30 Apr 2008, Stephen Davies wrote: > I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is > the same. > > Any ideas as to how to handle this? > > Stephen > > > On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: >> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: >>> The biggest problem that I have seen with lockfiles on Linux >>> At least is, that it seems there is no standard with respect >>> To the folder in which they should be created. Also, many >>> Distributions seem to set up file system permissions in such >>> A way that writing to the lockfile folder is not allowed for >>> The normal user -- that's why we stopped using lockfiles >>> In our commercial product. >> >> It seems it depends on the expectations. I consider it as a >> feature that by default a linux user cannot access serial ports. >> Maybe root connected a modem (can produce phone bills) or even >> some serial card reader, maybe with the web servers key pair. >> >> I would expect that by default a user cannot open the serial port >> because of insufficient permissions on the device file. I would >> expect this on other unices as well (but I don't know it). >> >> For windows I think it should be similar but not impacting so >> much in practice, because often windows users work with big >> permissions on a somewhat high priviledge level or even >> Administrator. >> >>> If we are to still respect lockfiles, we first need to >>> Understand where we are expected to look for them. Does >>> Anybody have any insight what variants of lockfile folder >>> Schema exist out there in the wild? Some apps like minicom >>> Seem to even allow users to manually specify a lockfile >>> Folder of their choice. >> >> At least my (ancient) minicom does not allow the user to change >> this option, it is displayed but read-only, but root is allowed >> to change it. >> >>> Because of the difficulty finding the right lockfile folder, >>> And because of the inherent risk of thinking that something >>> Might be locked while it actually isn't, I'd suggest that >>> RXTX should have a "soft-off" feature that allows disabling >>> ALL Lockfile checks at runtime without recompiling the native >>> Sharedlibs. >> >> sounds very reasonable, yes... >> and as admin I would not wish that users could skip such >> locking because they do things wrong by default ;) >> >> (in the end I guess that is related to the dilemma, that >> hotplug/user-owned-periphery and multi-user systems simply >> conflict) >> >>> Trent - I like your strategy outline, but I think that it >>> Needs to be configurable by the client such that users and/or >>> Customer Support can disable lockfiles / disable ioctl in >>> Case they detect that they are runing on an OS / Kernal that >>> Does not support one or the other. >> >> Yes, this would be good I guess... Applications could offer >> configuration options to control that, maybe similarily as >> minicom. >> >> BTW, man minicom tells: >> >> *B - Lock file location >> On most systems This should be /usr/spool/uucp. >> Linux systems use /var/lock. If this directory >> does not exist, minicom will not attempt to use >> lockfiles. >> >> The statement `Linux systems use /var/lock' is interesting, does >> anyone know the source of this convention? >> >> oki, >> >> Steffen >> >> About Ingenico Throughout the world businesses rely on Ingenico for secure >> and expedient electronic transaction acceptance. Ingenico products leverage >> proven technology, established standards and unparalleled ergonomics to >> provide optimal reliability, versatility and usability. This comprehensive >> range of products is complemented by a global array of services and >> partnerships, enabling businesses in a number of vertical sectors to accept >> transactions anywhere their business takes them. www.ingenico.com This >> message may contain confidential and/or privileged information. If you are >> not the addressee or authorized to receive this for the addressee, you must >> not use, copy, disclose or take any action based on this message or any >> information herein. If you have received this message in error, please >> advise the sender immediately by reply e-mail and delete this message. >> Thank you for your cooperation. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0047.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0045.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0032.html From pboulton at pulsetracer.com Fri Apr 18 14:30:13 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Fri, 18 Apr 2008 13:30:13 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site Message-ID: <480904D5.1060307@pulsetracer.com> Hello, gentle serial porters. I have downloaded the zipped up binaries for use on Windows without Sun's CommAPI, but don't seem able to extract anything from the download. Go to main page, http://www.rxtx.org/ Click on Downloads I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) And I save it to disk. If I try and extract the files with WinZip, Winzip thinks the archive is corrupt. If I try using Windows Explorer, I am able to extract it into a single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than the original .zip. Any help would be much appreciated. Sincerely, Philip Boulton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080418/97d89793/attachment-0030.html From tjarvi at qbang.org Fri Apr 18 19:07:00 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 18 Apr 2008 19:07:00 -0600 (MDT) Subject: [Rxtx] Difficulty opening zip file at rxtx site In-Reply-To: <480904D5.1060307@pulsetracer.com> References: <480904D5.1060307@pulsetracer.com> Message-ID: On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org From pboulton at pulsetracer.com Sat Apr 19 12:46:26 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Sat, 19 Apr 2008 11:46:26 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site References: <480904D5.1060307@pulsetracer.com> Message-ID: <53DB7576450695419E09299104043761A78533@ZTGSERVER.ztg.local> I have been able to get my hands on the binaries, by going to the ftp directory /pub/rxtx at ftp.qbang.org,, and ftping the file rxtx-2.1-7-bins-r2.zip . This opens happily with Winzip, and extracts as the set of files that you describe below. I only experience the ill-formed archive problem by clicking the link on the rxtx.org Downloads page (http://rxtx.qbang.org/pub/rxtx/ rxtx-2.1-7-bins-r2.zip ). Not sure what to make of that. Philip Boulton ________________________________ From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Fri 4/18/2008 6:07 PM To: Philip Boulton Cc: rxtx at qbang.org Subject: Re: [Rxtx] Difficulty opening zip file at rxtx site On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080419/147923bb/attachment-0029.html From jlar310 at gmail.com Sat Apr 19 19:11:55 2008 From: jlar310 at gmail.com (Jeff Larsen) Date: Sat, 19 Apr 2008 20:11:55 -0500 Subject: [Rxtx] Moxa serial over Ethernet driver Message-ID: Hi all, I've been using javax.comm for years to communicate with a legacy radio data system. We want to migrate the java side of the system to a VMware Server virtual machine. We've had great success using Moxa DE-303 and 5610 serial over Ethernet appliances and virtual machines for running hylafax. The OS (Linux in this case) uses a kernel driver to communicate with the Moxa via a virtual serial port such as /dev/ttyr00. I want to do the same thing with javax.comm or gnu.io to connect to a virtual serial port. However I'm hitting road blocks everywhere. javax.comm for Linux sees the virtual port, but there are transmission errors. Tried Solaris too, but the Solaris Moxa drivers don't play nice with javax.comm because the driver uses /dev/pts/n instead of /dev/term/x. Next I tried RXTX on Linux, but I'm getting NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX on Solaris. Has anyone used RXTX with serial over Ethernet devices? Any hints on how to make it work? I know that I'm not completely off track because javax.comm does work with Moxa on a Windows platform, but that's just not an option for production deployment. -- Jeff From tjarvi at qbang.org Sat Apr 19 21:08:41 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 19 Apr 2008 21:08:41 -0600 (MDT) Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: yOn Sat, 19 Apr 2008, Jeff Larsen wrote: > Hi all, > > I've been using javax.comm for years to communicate with a legacy > radio data system. We want to migrate the java side of the system to a > VMware Server virtual machine. We've had great success using Moxa > DE-303 and 5610 serial over Ethernet appliances and virtual machines > for running hylafax. The OS (Linux in this case) uses a kernel driver > to communicate with the Moxa via a virtual serial port such as > /dev/ttyr00. > > I want to do the same thing with javax.comm or gnu.io to connect to a > virtual serial port. However I'm hitting road blocks everywhere. > javax.comm for Linux sees the virtual port, but there are transmission > errors. Tried Solaris too, but the Solaris Moxa drivers don't play > nice with javax.comm because the driver uses /dev/pts/n instead of > /dev/term/x. Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris. > > Has anyone used RXTX with serial over Ethernet devices? Any hints on > how to make it work? > > I know that I'm not completely off track because javax.comm does work > with Moxa on a Windows platform, but that's just not an option for > production deployment. > > Moxa should work under linux. There may be minor issues depending upon how complete the kernel driver is but I think it will work. One of the minor issues is /dev/ttyr00 is not enumerated. There are several work arounds documented with the source code and on the wiki. The easiest solution for testing purposes is to make a symbolic link from /dev/ttyr00 to a port that is enumerated such as /dev/ttyS129. You can later alter the rxtx source or use properties to change the enumerated ports. -- Trent Jarvi tjarvi at qbang.org From d.tonhofer at m-plify.com Sun Apr 20 03:33:30 2008 From: d.tonhofer at m-plify.com (David Tonhofer (M-PLIFY S.A.)) Date: Sun, 20 Apr 2008 11:33:30 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: <480B0DEA.5010908@m-plify.com> Jeff Larsen wrote: > Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris It might be that the Java side of RXTX does not recognize that portname. Trying modifying src/RXTXCommDriver.java as described in this case: http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card From ajmas at sympatico.ca Sun Apr 20 16:37:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Apr 2008 18:37:59 -0400 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <480B0DEA.5010908@m-plify.com> References: <480B0DEA.5010908@m-plify.com> Message-ID: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > Jeff Larsen wrote: >> Next I tried RXTX on Linux, but I'm getting >> NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX >> on Solaris > It might be that the Java side of RXTX does not recognize that > portname. > Trying modifying src/RXTXCommDriver.java as described in this case: > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card I wonder whether it would be worth allowing custom port prefixes as a system parameter? For example: gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" Andre From Martin.Oberhuber at windriver.com Tue Apr 22 12:34:36 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 22 Apr 2008 20:34:36 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> References: <480B0DEA.5010908@m-plify.com> <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE6485848056CD6CE@ism-mail03.corp.ad.wrs.com> Sounds like a great idea... I'm wondering how the "variable part" after the Prefixes could be specified though? What about allowing Regular Expression character Classes in the existing System Property for specifying ports: System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyS[0-9],ttyS[ABC],ttyUSB[0-9a-z]"); The set of allowed patterns would of course need to Be restricted compared to REGEX, because it must be A syntax that supports iterating over it. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Montag, 21. April 2008 00:38 > To: rxtx at qbang.org and Users > Subject: Re: [Rxtx] Moxa serial over Ethernet driver > > > On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > > Jeff Larsen wrote: > >> Next I tried RXTX on Linux, but I'm getting > >> NoSuchPortException connecting to /dev/ttyr00. I have yet > to try RXTX > >> on Solaris > > It might be that the Java side of RXTX does not recognize that > > portname. > > Trying modifying src/RXTXCommDriver.java as described in this case: > > > > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_ > SST-4P.2FLP_multiport_card > > I wonder whether it would be worth allowing custom port > prefixes as a > system parameter? For > example: > > gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Loi.TRAN at weatherford.com Tue Apr 22 13:10:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Tue, 22 Apr 2008 14:10:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled Message-ID: Hi, I'm currently using the Java RXTX API to interface to a serial port. The serial port is connected to a bridge board that communicates with our communications system running at 1.875 Mbps which is linked to an embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no flow control). I send a command to the embedded board through the serial-bridge board which then is relayed to the embedded board. The command sent asks the embedded board to dump a binary image. Here's where I'm hitting some problems. I've successfully done this is an integrated serial port from the laptop. The binary file that comes back is consistent on every attempt. When I use the application I've written to do the same thing with a USB-to-serial adapter, the image I get back is not the same as the image I receive through the USB-to-serial adapter is not consistent at all. A final thing is that when I use a terminal program to dump the binary image with the USB-serial adapter, the image is correct. Every time! What is the terminal program doing that's not being done in my application? My application is quite simple. Has anyone observed this behavior before? If you have, I'd like to know how you've gotten around this problem. Thanks, LT =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From tjarvi at qbang.org Tue Apr 22 21:11:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 22 Apr 2008 21:11:10 -0600 (MDT) Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org From Loi.TRAN at weatherford.com Wed Apr 23 08:35:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Wed, 23 Apr 2008 09:35:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: Thanks for all the responses. I finally tried something that worked consistently. I updated my Prolific driver and repeated my tests. It worked. If you're using the Prolific type USB-serial adapters, do no use the Prolific version 2.0.2.1 driver on Windows. Update it to the latest 2.0.2.8 version. Again, thanks for all the responses. LT -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Tuesday, April 22, 2008 10:11 PM To: TRAN, Loi X. Cc: rxtx at qbang.org Subject: Re: [Rxtx] Prolific USB - RXTX data mangled On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From Martin.Oberhuber at windriver.com Wed Apr 23 18:54:26 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 02:54:26 +0200 Subject: [Rxtx] RXTX port locking on Linux status? Message-ID: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Dear RXTX community, I'm wondering what the status is with RXTX locking serial ports on Linux? My understanding is that the mechanism used in 2.1-7r2 (lockfiles) is not really state of the art, and has lots of problems (e.g. missing permissions). There was an idea to migrate towards a Kernel syscall based solution for port locking. What's the status here? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/9878db9f/attachment-0025.html From tjarvi at qbang.org Wed Apr 23 20:32:24 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Apr 2008 20:32:24 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > Dear RXTX community, > > I'm wondering what the status is with RXTX locking > serial ports on Linux? > > My understanding is that the mechanism used in > 2.1-7r2 (lockfiles) is not really state of the art, and > has lots of problems (e.g. missing permissions). > > There was an idea to migrate towards a Kernel > syscall based solution for port locking. > > What's the status here? > Hi Martin, I'm in favor of deprecating the current FHS locking mechanism in favor of an IOCTL when available. I think it will be available on all the platforms but do not know for sure. The status is unchanged. I've had very few free cycles for such things. Feel free to take a stab at it if you have some time. I believe the IOCTL is used in the Mac OS X code already. I don't see any real backwards compatability issues and the IOCTL should just work. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Apr 24 06:14:06 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 14:14:06 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Thanks Trent. Problem is only that I'm really not at all Familiar with the C part of RXTX. If there Were anything I could do in Java for this, It would be easier for me.... ... Are there any C experts here on the list Who'd like to look at ioctl port locking For linux? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Donnerstag, 24. April 2008 04:32 > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > I'm wondering what the status is with RXTX locking > > serial ports on Linux? > > > > My understanding is that the mechanism used in > > 2.1-7r2 (lockfiles) is not really state of the art, and > > has lots of problems (e.g. missing permissions). > > > > There was an idea to migrate towards a Kernel > > syscall based solution for port locking. > > > > What's the status here? > > > > Hi Martin, > > I'm in favor of deprecating the current FHS locking mechanism > in favor of > an IOCTL when available. I think it will be available on all the > platforms but do not know for sure. > > The status is unchanged. I've had very few free cycles for > such things. > Feel free to take a stab at it if you have some time. I > believe the IOCTL > is used in the Mac OS X code already. > > I don't see any real backwards compatability issues and the > IOCTL should > just work. > > -- > Trent Jarvi > tjarvi at qbang.org > From sspies at sloc.de Thu Apr 24 07:15:36 2008 From: sspies at sloc.de (Sebastian Spies) Date: Thu, 24 Apr 2008 15:15:36 +0200 (CEST) Subject: [Rxtx] rxtx on gumstix: Interrupted system call In-Reply-To: <47FB7B20.7080504@sloc.de> References: <47FB7B20.7080504@sloc.de> Message-ID: <55445.130.83.139.205.1209042936.squirrel@ssl.sloc.de> Dear list, while porting rxtx to the gumstix, I found out, that select used in readArray in SerialImp.c might not work as expected. Maybe, because of missing TIOCSERGETLSR-support? select is often interrupted, so i wrote the following quick'n'dirty hack to make it work on gumstix: diff -Nur rxtx-2.1-7r2/src/SerialImp.c rxtx-2.1-7r2/src/SerialImp.c --- rxtx-2.1-7r2/src/SerialImp.c 2006-01-29 23:19:04.000000000 +0100 +++ rxtx-2.1-7r2-patched/src/SerialImp.c 2008-04-24 14:30:17.000000000 +0200 @@ -3380,7 +3381,7 @@ JNIEXPORT jint JNICALL RXTXPort(readArray)( JNIEnv *env, jobject jobj, jbyteArray jbarray, jint offset, jint length ) { - int bytes; + int bytes = 0; jbyte *body; /* char msg[80]; */ int fd = get_java_var( env, jobj, "fd", "I" ); @@ -3397,9 +3398,18 @@ "readArray", "Invalid length" ); return -1; } - body = (*env)->GetByteArrayElements( env, jbarray, 0 ); - bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ - (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + while(1 > bytes) + { + body = (*env)->GetByteArrayElements( env, jbarray, 0 ); + bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ + (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + // quick'n'dirty - SSP + report (" trying again... \n"); + errno = 0; + } + if( bytes < 0 ) { report( "RXTXPort:readArray bytes < 0" ); LEAVE( "RXTXPort:readArray" ); > Hey, > > I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use > RXTXPort$SerialInputStream.read(), then I get the following Exception. I > did not yet figure out which system call is interrupted as strace > produces loads of output. > > Any help would be very appreciated. Thanks in advance. > Sebastian > > > [java] java.io.IOException: Interrupted system call in readArray > [java] at gnu.io.RXTXPort.readArray(Native Method) > [java] at > gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) > [java] at > java.io.FilterInputStream.read(FilterInputStream.java:189) > [java] at > java.io.BufferedInputStream.refill(BufferedInputStream.java:371) > [java] at > java.io.BufferedInputStream.read(BufferedInputStream.java:229) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) > [java] at > com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) > > -- > Sebastian Spies > > mail: sspies at sloc.de > > > > From fire_baptized at hotmail.com Thu Apr 24 18:27:48 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Thu, 24 Apr 2008 20:27:48 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hello I am having a problem with the serial device connecting (software wise) to the serial port. However I have a test program and it seems to work just fine in that environment - and it doesnt use GUI. The error I am getting is : PortNotFoundException Now the way I have it setup in the GUI environment is that once the user pushes a JButton the program connects using this class: protected void establishConnection() { try { portId = CommPortIdentifier.getPortIdentifier("COM3"); System.out.println("Establishing connction....."); messages[0] = "\nEstablishing connction.....\n"; } catch ( NoSuchPortException noport) { System.out.println("Port not found: "+ noport); messages[0] = "Port not found: "+ noport+"\n"; } try { serialPort = (SerialPort) portId.open("serial", 50); System.out.println("Port has been found."); messages[1] = "Port has been found.\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[1] = "" +usedport; } try { serialPort = (SerialPort) portId.open("serial", 50); messages[2] = "Connecting to COM3 on port 50....\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; } try { serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); System.out.println("Esablishing the transfer rate settings for COM3."); messages[3] = "Esablishing the transfer rate settings for COM3.\n"; } catch (UnsupportedCommOperationException nosupcom) { System.out.println(nosupcom); System.out.println("The tranfer rate could not be esblished on COM3."); messages[3] = "The tranfer rate could not be esblished on COM3.\n"; } System.out.println(serialPort.getFlowControlMode()); messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; //sendDataOut(buffer[3],buffer[4]); } I need all the data in this method (and all the string values in this method) to be printed out on a JTextArea. I wont do me any good if not all the text is printed on a JTextArea in another class. So I have the text printing the JTextArea correctly, but everytime the JButton is activated - it gives me that error message. I did add a disconnect button that is supposed to call the serialPort.close(). _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/273fd4ec/attachment-0024.html From tjarvi at qbang.org Thu Apr 24 21:54:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Apr 2008 21:54:10 -0600 (MDT) Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > Hello I am having a problem with the serial device connecting (software > wise) to the serial port. However I have a test program and it seems to > work just fine in that environment - and it doesnt use GUI. The error I > am getting is : PortNotFoundException Now the way I have it setup in the > GUI environment is that once the user pushes a JButton the program > connects using this class: > > protected void establishConnection() { > try { > portId = CommPortIdentifier.getPortIdentifier("COM3"); > System.out.println("Establishing connction....."); > messages[0] = "\nEstablishing connction.....\n"; > } > catch ( NoSuchPortException noport) { > System.out.println("Port not found: "+ noport); > messages[0] = "Port not found: "+ noport+"\n"; > } > try { > serialPort = (SerialPort) portId.open("serial", 50); > System.out.println("Port has been found."); > messages[1] = "Port has been found.\n"; > } > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[1] = "" +usedport; > } ================================================================= > try { > serialPort = (SerialPort) portId.open("serial", 50); > messages[2] = "Connecting to COM3 on port 50....\n"; > } ================================================================== > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > } > try { > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > System.out.println("Esablishing the transfer rate settings for COM3."); > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > } > catch (UnsupportedCommOperationException nosupcom) { > System.out.println(nosupcom); > System.out.println("The tranfer rate could not be esblished on COM3."); > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > } > System.out.println(serialPort.getFlowControlMode()); > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > //sendDataOut(buffer[3],buffer[4]); > } > > I need all the data in this method (and all the string values in this > method) to be printed out on a JTextArea. I wont do me any good if not > all the text is printed on a JTextArea in another class. So I have the > text printing the JTextArea correctly, but everytime the JButton is > activated - it gives me that error message. I did add a disconnect > button that is supposed to call the serialPort.close(). > The open code used twice is going to throw an exception. It may be that you catch the exception above this code and print a confusing message? A common mistake is people will accidently run two copies of their program. The first instance of the program will open the port and prevent enumeration (finding the port) in the second instance of the program. As an example, you may be running your text based application which is preventing the GUI from seeing the port. Enumeration is done by trying to open the port. If the port is open, Enumeration fails. -- Trent Jarvi tjarvi at qbang.org From fire_baptized at hotmail.com Thu Apr 24 22:32:05 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 00:32:05 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Wow - thanks dude what a dumb thing for me to not catch..... now here is the current problem - right now I am trying to output data again one is with the test program - and it seems that serialPort.setRTS(true); is throwing an exceptions there - now if I show this code please bare in mind that I am only testing - the code is kinda sloppy in my mind - but if I can figure out why calling this function is throwing an exception then maybe I can figure out why my GUI application is getting the same null pointer exceptions when try to send out the data stream. FYI Trent this email is not directed towards you - anyone can jump in on this public static void main(String args[]) { byte[] b = new byte[64]; int keyinput = 0 ; byte x = 0; byte y = 0; PortTesting1 testports = new PortTesting1(); try { joyskoro = Joystick.createInstance(); } catch (IOException ioexc) { System.out.println("There is an input/output problem: " + ioexc); } while (true) { joyskoro.poll(); b[0] = ((byte) -(10 * joyskoro.getY())); b[1] = ((byte) (10 * joyskoro.getX())); System.out.println("The 3rd byte is: " +b[0]); System.out.println("The 4rd byte is: " +b[1]); serialPort.setRTS(true); // HERE IS WHERE THE PROBLEM IS !!!!!!! ON THIS LINE but if I dont have it active in my program the Bluetooth device (that is System.out.println("Ready to send :-) !"); //connected to the serial port does not send out data!!!!! if (joyskoro.isButtonDown(joyskoro.BUTTON10)) { System.out.println("Connection terminated."); serialPort.close(); break; } if (joyskoro.isButtonDown(joyskoro.BUTTON2)) { boolean flag = true; //reading from key input from the keyboard System.out.println("Please input a command: "); while (flag) { try { keyinput = System.in.read(); } catch (IOException ioexc) {/*there is no need to put * anything here */ } if((char)keyinput=='w') { pushIt((byte)85); } if((char)keyinput=='s') { pushIt((byte)84); } if((char)keyinput=='a') { pushIt((byte)83); } if((char)keyinput=='d') { pushIt((byte)82); } if((char)keyinput=='q') { pushIt((byte)89); } if((char)keyinput=='\t') { //this stop reading input from the keyboard flag = false; } } and help anyways here is the block of code that throwing an exception for the test program: > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/5c8f7d68/attachment-0024.html From fire_baptized at hotmail.com Fri Apr 25 07:59:53 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 09:59:53 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Are there any examples of how to push out data? As in using input and output streams - if I can compare code maybe I can see where this is causing a problem. I have a byte array that I am pushing out data. I keep getting null pointer exceptions every where I turn. > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/22228ab6/attachment-0023.html From ajmas at sympatico.ca Sat Apr 26 07:37:09 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 26 Apr 2008 09:37:09 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hi, On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote: > > Are there any examples of how to push out data? As in using input > and output streams - if I can compare code maybe I can see where > this is causing a problem. I have a byte array that I am pushing > out data. I keep getting null pointer exceptions every where I turn. > There are some examples here that might be of help: http://rxtx.qbang.org/wiki/index.php/Examples Andre From fire_baptized at hotmail.com Sat Apr 26 20:13:54 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Sat, 26 Apr 2008 22:13:54 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: looked at those....yep didnt help - I need to push out data with GUI and not get a null pointer exception everytime I try. > CC: rxtx at qbang.org> From: ajmas at sympatico.ca> To: fire_baptized at hotmail.com> Subject: Re: [Rxtx] Serial Problems with Gui.....> Date: Sat, 26 Apr 2008 09:37:09 -0400> > Hi,> > > On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote:> >> > Are there any examples of how to push out data? As in using input > > and output streams - if I can compare code maybe I can see where > > this is causing a problem. I have a byte array that I am pushing > > out data. I keep getting null pointer exceptions every where I turn.> >> > There are some examples here that might be of help:> > http://rxtx.qbang.org/wiki/index.php/Examples> > Andre _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080426/09f95b41/attachment-0022.html From michael.erskine at ketech.com Mon Apr 28 02:47:22 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 28 Apr 2008 09:47:22 +0100 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D426EF3CBBC5@no-sv-03.ketech.local> Jesrael D. Summerhill wrote: > looked at those....yep didnt help - I need to push out data with GUI and > not get a null pointer exception everytime I try. So it seems pretty obvious that your code needs to check for nulls wherever one may occur and report what's happening. Alternatively, catch the npe and display the stack trace. Then you can fix your code so it doesn't try to work with something that ain't there. Regards, Michael Erskine. From scldad at sdc.com.au Mon Apr 28 03:58:34 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Mon, 28 Apr 2008 19:28:34 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Message-ID: <200804281928.34454.scldad@sdc.com.au> Has anybody done any design work on this? The first thing that springs to mind is that we still need to check for lock files because other apps tend to use that approach even if we go to ioctl. Cheers, Stephen Davies On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > Thanks Trent. > > Problem is only that I'm really not at all > Familiar with the C part of RXTX. If there > Were anything I could do in Java for this, > It would be easier for me.... > > ... Are there any C experts here on the list > Who'd like to look at ioctl port locking > For linux? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > -----Original Message----- > > From: Trent Jarvi [mailto:tjarvi at qbang.org] > > Sent: Donnerstag, 24. April 2008 04:32 > > To: Oberhuber, Martin > > Cc: rxtx at qbang.org > > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > > > I'm wondering what the status is with RXTX locking > > > serial ports on Linux? > > > > > > My understanding is that the mechanism used in > > > 2.1-7r2 (lockfiles) is not really state of the art, and > > > has lots of problems (e.g. missing permissions). > > > > > > There was an idea to migrate towards a Kernel > > > syscall based solution for port locking. > > > > > > What's the status here? > > > > Hi Martin, > > > > I'm in favor of deprecating the current FHS locking mechanism > > in favor of > > an IOCTL when available. I think it will be available on all the > > platforms but do not know for sure. > > > > The status is unchanged. I've had very few free cycles for > > such things. > > Feel free to take a stab at it if you have some time. I > > believe the IOCTL > > is used in the Mac OS X code already. > > > > I don't see any real backwards compatability issues and the > > IOCTL should > > just work. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Mon Apr 28 04:21:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 28 Apr 2008 04:21:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804281928.34454.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: I don't think there would need to be any architectural changes. A couple ifdefs and minor changes in the current code should be enough. Proposal: FHS/UUCP locks: continue to respect them, try to create them but do not error if the IOCTL is supported. (But does the IOCTL being defined mean it will work?) Enumeration: Do not assert the IOCTL while opening. Serial.open: assert the IOCTL after open. Continue to use locks as described above after asserting the IOCTL. If the IOCTL is defined but not working, handle it here. Failure cases include the IOCTL is not supported and the port is already locked. On Mon, 28 Apr 2008, Stephen Davies wrote: > Has anybody done any design work on this? > The first thing that springs to mind is that we still need to check for lock > files because other apps tend to use that approach even if we go to ioctl. > > Cheers, > Stephen Davies > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: >> Thanks Trent. >> >> Problem is only that I'm really not at all >> Familiar with the C part of RXTX. If there >> Were anything I could do in Java for this, >> It would be easier for me.... >> >> ... Are there any C experts here on the list >> Who'd like to look at ioctl port locking >> For linux? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >>> -----Original Message----- >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] >>> Sent: Donnerstag, 24. April 2008 04:32 >>> To: Oberhuber, Martin >>> Cc: rxtx at qbang.org >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? >>> >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: >>>> Dear RXTX community, >>>> >>>> I'm wondering what the status is with RXTX locking >>>> serial ports on Linux? >>>> >>>> My understanding is that the mechanism used in >>>> 2.1-7r2 (lockfiles) is not really state of the art, and >>>> has lots of problems (e.g. missing permissions). >>>> >>>> There was an idea to migrate towards a Kernel >>>> syscall based solution for port locking. >>>> >>>> What's the status here? >>> >>> Hi Martin, >>> >>> I'm in favor of deprecating the current FHS locking mechanism >>> in favor of >>> an IOCTL when available. I think it will be available on all the >>> platforms but do not know for sure. >>> >>> The status is unchanged. I've had very few free cycles for >>> such things. >>> Feel free to take a stab at it if you have some time. I >>> believe the IOCTL >>> is used in the Mac OS X code already. >>> >>> I don't see any real backwards compatability issues and the >>> IOCTL should >>> just work. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Tue Apr 29 12:04:04 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Apr 2008 20:04:04 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Hi all, The biggest problem that I have seen with lockfiles on Linux At least is, that it seems there is no standard with respect To the folder in which they should be created. Also, many Distributions seem to set up file system permissions in such A way that writing to the lockfile folder is not allowed for The normal user -- that's why we stopped using lockfiles In our commercial product. If we are to still respect lockfiles, we first need to Understand where we are expected to look for them. Does Anybody have any insight what variants of lockfile folder Schema exist out there in the wild? Some apps like minicom Seem to even allow users to manually specify a lockfile Folder of their choice. Because of the difficulty finding the right lockfile folder, And because of the inherent risk of thinking that something Might be locked while it actually isn't, I'd suggest that RXTX should have a "soft-off" feature that allows disabling ALL Lockfile checks at runtime without recompiling the native Sharedlibs. Trent - I like your strategy outline, but I think that it Needs to be configurable by the client such that users and/or Customer Support can disable lockfiles / disable ioctl in Case they detect that they are runing on an OS / Kernal that Does not support one or the other. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Montag, 28. April 2008 12:22 > To: Stephen Davies > Cc: rxtx at qbang.org; Oberhuber, Martin; Trent Jarvi > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > I don't think there would need to be any architectural > changes. A couple > ifdefs and minor changes in the current code should be enough. > > Proposal: > > FHS/UUCP locks: > continue to respect them, try to create them but do not error if > the IOCTL is supported. (But does the IOCTL being defined mean > it will work?) > Enumeration: > Do not assert the IOCTL while opening. > Serial.open: > assert the IOCTL after open. Continue to use locks as described > above after asserting the IOCTL. If the IOCTL is defined but > not working, handle it here. Failure cases include the IOCTL > is not supported and the port is already locked. > > On Mon, 28 Apr 2008, Stephen Davies wrote: > > > Has anybody done any design work on this? > > The first thing that springs to mind is that we still need > to check for lock > > files because other apps tend to use that approach even if > we go to ioctl. > > > > Cheers, > > Stephen Davies > > > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > >> Thanks Trent. > >> > >> Problem is only that I'm really not at all > >> Familiar with the C part of RXTX. If there > >> Were anything I could do in Java for this, > >> It would be easier for me.... > >> > >> ... Are there any C experts here on the list > >> Who'd like to look at ioctl port locking > >> For linux? > >> > >> Thanks, > >> -- > >> Martin Oberhuber, Senior Member of Technical Staff, Wind River > >> Target Management Project Lead, DSDP PMC Member > >> http://www.eclipse.org/dsdp/tm > >> > >>> -----Original Message----- > >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] > >>> Sent: Donnerstag, 24. April 2008 04:32 > >>> To: Oberhuber, Martin > >>> Cc: rxtx at qbang.org > >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? > >>> > >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > >>>> Dear RXTX community, > >>>> > >>>> I'm wondering what the status is with RXTX locking > >>>> serial ports on Linux? > >>>> > >>>> My understanding is that the mechanism used in > >>>> 2.1-7r2 (lockfiles) is not really state of the art, and > >>>> has lots of problems (e.g. missing permissions). > >>>> > >>>> There was an idea to migrate towards a Kernel > >>>> syscall based solution for port locking. > >>>> > >>>> What's the status here? > >>> > >>> Hi Martin, > >>> > >>> I'm in favor of deprecating the current FHS locking mechanism > >>> in favor of > >>> an IOCTL when available. I think it will be available on all the > >>> platforms but do not know for sure. > >>> > >>> The status is unchanged. I've had very few free cycles for > >>> such things. > >>> Feel free to take a stab at it if you have some time. I > >>> believe the IOCTL > >>> is used in the Mac OS X code already. > >>> > >>> I don't see any real backwards compatability issues and the > >>> IOCTL should > >>> just work. > >>> > >>> -- > >>> Trent Jarvi > >>> tjarvi at qbang.org > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > From Steffen.DETTMER at ingenico.com Tue Apr 29 13:34:44 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 29 Apr 2008 21:34:44 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Message-ID: <20080429193444.GU2928@elberon.bln.de.ingenico.com> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > The biggest problem that I have seen with lockfiles on Linux > At least is, that it seems there is no standard with respect > To the folder in which they should be created. Also, many > Distributions seem to set up file system permissions in such > A way that writing to the lockfile folder is not allowed for > The normal user -- that's why we stopped using lockfiles > In our commercial product. It seems it depends on the expectations. I consider it as a feature that by default a linux user cannot access serial ports. Maybe root connected a modem (can produce phone bills) or even some serial card reader, maybe with the web servers key pair. I would expect that by default a user cannot open the serial port because of insufficient permissions on the device file. I would expect this on other unices as well (but I don't know it). For windows I think it should be similar but not impacting so much in practice, because often windows users work with big permissions on a somewhat high priviledge level or even Administrator. > If we are to still respect lockfiles, we first need to > Understand where we are expected to look for them. Does > Anybody have any insight what variants of lockfile folder > Schema exist out there in the wild? Some apps like minicom > Seem to even allow users to manually specify a lockfile > Folder of their choice. At least my (ancient) minicom does not allow the user to change this option, it is displayed but read-only, but root is allowed to change it. > Because of the difficulty finding the right lockfile folder, > And because of the inherent risk of thinking that something > Might be locked while it actually isn't, I'd suggest that > RXTX should have a "soft-off" feature that allows disabling > ALL Lockfile checks at runtime without recompiling the native > Sharedlibs. sounds very reasonable, yes... and as admin I would not wish that users could skip such locking because they do things wrong by default ;) (in the end I guess that is related to the dilemma, that hotplug/user-owned-periphery and multi-user systems simply conflict) > Trent - I like your strategy outline, but I think that it > Needs to be configurable by the client such that users and/or > Customer Support can disable lockfiles / disable ioctl in > Case they detect that they are runing on an OS / Kernal that > Does not support one or the other. Yes, this would be good I guess... Applications could offer configuration options to control that, maybe similarily as minicom. BTW, man minicom tells: *B - Lock file location On most systems This should be /usr/spool/uucp. Linux systems use /var/lock. If this directory does not exist, minicom will not attempt to use lockfiles. The statement `Linux systems use /var/lock' is interesting, does anyone know the source of this convention? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Tue Apr 29 16:11:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Apr 2008 16:11:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? These details are outlined in the Filesystem Hierarchy Standard (FHS). http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLOCKLOCKFILES -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Tue Apr 29 18:58:09 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Wed, 30 Apr 2008 10:28:09 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: <200804301028.09307.scldad@sdc.com.au> I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is the same. Any ideas as to how to handle this? Stephen On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: > * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > > The biggest problem that I have seen with lockfiles on Linux > > At least is, that it seems there is no standard with respect > > To the folder in which they should be created. Also, many > > Distributions seem to set up file system permissions in such > > A way that writing to the lockfile folder is not allowed for > > The normal user -- that's why we stopped using lockfiles > > In our commercial product. > > It seems it depends on the expectations. I consider it as a > feature that by default a linux user cannot access serial ports. > Maybe root connected a modem (can produce phone bills) or even > some serial card reader, maybe with the web servers key pair. > > I would expect that by default a user cannot open the serial port > because of insufficient permissions on the device file. I would > expect this on other unices as well (but I don't know it). > > For windows I think it should be similar but not impacting so > much in practice, because often windows users work with big > permissions on a somewhat high priviledge level or even > Administrator. > > > If we are to still respect lockfiles, we first need to > > Understand where we are expected to look for them. Does > > Anybody have any insight what variants of lockfile folder > > Schema exist out there in the wild? Some apps like minicom > > Seem to even allow users to manually specify a lockfile > > Folder of their choice. > > At least my (ancient) minicom does not allow the user to change > this option, it is displayed but read-only, but root is allowed > to change it. > > > Because of the difficulty finding the right lockfile folder, > > And because of the inherent risk of thinking that something > > Might be locked while it actually isn't, I'd suggest that > > RXTX should have a "soft-off" feature that allows disabling > > ALL Lockfile checks at runtime without recompiling the native > > Sharedlibs. > > sounds very reasonable, yes... > and as admin I would not wish that users could skip such > locking because they do things wrong by default ;) > > (in the end I guess that is related to the dilemma, that > hotplug/user-owned-periphery and multi-user systems simply > conflict) > > > Trent - I like your strategy outline, but I think that it > > Needs to be configurable by the client such that users and/or > > Customer Support can disable lockfiles / disable ioctl in > > Case they detect that they are runing on an OS / Kernal that > > Does not support one or the other. > > Yes, this would be good I guess... Applications could offer > configuration options to control that, maybe similarily as > minicom. > > BTW, man minicom tells: > > *B - Lock file location > On most systems This should be /usr/spool/uucp. > Linux systems use /var/lock. If this directory > does not exist, minicom will not attempt to use > lockfiles. > > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure > and expedient electronic transaction acceptance. Ingenico products leverage > proven technology, established standards and unparalleled ergonomics to > provide optimal reliability, versatility and usability. This comprehensive > range of products is complemented by a global array of services and > partnerships, enabling businesses in a number of vertical sectors to accept > transactions anywhere their business takes them. www.ingenico.com This > message may contain confidential and/or privileged information. If you are > not the addressee or authorized to receive this for the addressee, you must > not use, copy, disclose or take any action based on this message or any > information herein. If you have received this message in error, please > advise the sender immediately by reply e-mail and delete this message. > Thank you for your cooperation. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Wed Apr 30 19:30:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 30 Apr 2008 19:30:51 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804301028.09307.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> <200804301028.09307.scldad@sdc.com.au> Message-ID: Hi Stephen, I suspect ioctl/TIOCEXCL open/O_EXCL would do the job. Mac uses TIOCEXCL and it is POSIX. We use O_EXCL for lockfiles on Linux already. On Wed, 30 Apr 2008, Stephen Davies wrote: > I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is > the same. > > Any ideas as to how to handle this? > > Stephen > > > On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: >> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: >>> The biggest problem that I have seen with lockfiles on Linux >>> At least is, that it seems there is no standard with respect >>> To the folder in which they should be created. Also, many >>> Distributions seem to set up file system permissions in such >>> A way that writing to the lockfile folder is not allowed for >>> The normal user -- that's why we stopped using lockfiles >>> In our commercial product. >> >> It seems it depends on the expectations. I consider it as a >> feature that by default a linux user cannot access serial ports. >> Maybe root connected a modem (can produce phone bills) or even >> some serial card reader, maybe with the web servers key pair. >> >> I would expect that by default a user cannot open the serial port >> because of insufficient permissions on the device file. I would >> expect this on other unices as well (but I don't know it). >> >> For windows I think it should be similar but not impacting so >> much in practice, because often windows users work with big >> permissions on a somewhat high priviledge level or even >> Administrator. >> >>> If we are to still respect lockfiles, we first need to >>> Understand where we are expected to look for them. Does >>> Anybody have any insight what variants of lockfile folder >>> Schema exist out there in the wild? Some apps like minicom >>> Seem to even allow users to manually specify a lockfile >>> Folder of their choice. >> >> At least my (ancient) minicom does not allow the user to change >> this option, it is displayed but read-only, but root is allowed >> to change it. >> >>> Because of the difficulty finding the right lockfile folder, >>> And because of the inherent risk of thinking that something >>> Might be locked while it actually isn't, I'd suggest that >>> RXTX should have a "soft-off" feature that allows disabling >>> ALL Lockfile checks at runtime without recompiling the native >>> Sharedlibs. >> >> sounds very reasonable, yes... >> and as admin I would not wish that users could skip such >> locking because they do things wrong by default ;) >> >> (in the end I guess that is related to the dilemma, that >> hotplug/user-owned-periphery and multi-user systems simply >> conflict) >> >>> Trent - I like your strategy outline, but I think that it >>> Needs to be configurable by the client such that users and/or >>> Customer Support can disable lockfiles / disable ioctl in >>> Case they detect that they are runing on an OS / Kernal that >>> Does not support one or the other. >> >> Yes, this would be good I guess... Applications could offer >> configuration options to control that, maybe similarily as >> minicom. >> >> BTW, man minicom tells: >> >> *B - Lock file location >> On most systems This should be /usr/spool/uucp. >> Linux systems use /var/lock. If this directory >> does not exist, minicom will not attempt to use >> lockfiles. >> >> The statement `Linux systems use /var/lock' is interesting, does >> anyone know the source of this convention? >> >> oki, >> >> Steffen >> >> About Ingenico Throughout the world businesses rely on Ingenico for secure >> and expedient electronic transaction acceptance. Ingenico products leverage >> proven technology, established standards and unparalleled ergonomics to >> provide optimal reliability, versatility and usability. This comprehensive >> range of products is complemented by a global array of services and >> partnerships, enabling businesses in a number of vertical sectors to accept >> transactions anywhere their business takes them. www.ingenico.com This >> message may contain confidential and/or privileged information. If you are >> not the addressee or authorized to receive this for the addressee, you must >> not use, copy, disclose or take any action based on this message or any >> information herein. If you have received this message in error, please >> advise the sender immediately by reply e-mail and delete this message. >> Thank you for your cooperation. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0048.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0046.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0033.html From pboulton at pulsetracer.com Fri Apr 18 14:30:13 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Fri, 18 Apr 2008 13:30:13 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site Message-ID: <480904D5.1060307@pulsetracer.com> Hello, gentle serial porters. I have downloaded the zipped up binaries for use on Windows without Sun's CommAPI, but don't seem able to extract anything from the download. Go to main page, http://www.rxtx.org/ Click on Downloads I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) And I save it to disk. If I try and extract the files with WinZip, Winzip thinks the archive is corrupt. If I try using Windows Explorer, I am able to extract it into a single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than the original .zip. Any help would be much appreciated. Sincerely, Philip Boulton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080418/97d89793/attachment-0031.html From tjarvi at qbang.org Fri Apr 18 19:07:00 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 18 Apr 2008 19:07:00 -0600 (MDT) Subject: [Rxtx] Difficulty opening zip file at rxtx site In-Reply-To: <480904D5.1060307@pulsetracer.com> References: <480904D5.1060307@pulsetracer.com> Message-ID: On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org From pboulton at pulsetracer.com Sat Apr 19 12:46:26 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Sat, 19 Apr 2008 11:46:26 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site References: <480904D5.1060307@pulsetracer.com> Message-ID: <53DB7576450695419E09299104043761A78533@ZTGSERVER.ztg.local> I have been able to get my hands on the binaries, by going to the ftp directory /pub/rxtx at ftp.qbang.org,, and ftping the file rxtx-2.1-7-bins-r2.zip . This opens happily with Winzip, and extracts as the set of files that you describe below. I only experience the ill-formed archive problem by clicking the link on the rxtx.org Downloads page (http://rxtx.qbang.org/pub/rxtx/ rxtx-2.1-7-bins-r2.zip ). Not sure what to make of that. Philip Boulton ________________________________ From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Fri 4/18/2008 6:07 PM To: Philip Boulton Cc: rxtx at qbang.org Subject: Re: [Rxtx] Difficulty opening zip file at rxtx site On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080419/147923bb/attachment-0030.html From jlar310 at gmail.com Sat Apr 19 19:11:55 2008 From: jlar310 at gmail.com (Jeff Larsen) Date: Sat, 19 Apr 2008 20:11:55 -0500 Subject: [Rxtx] Moxa serial over Ethernet driver Message-ID: Hi all, I've been using javax.comm for years to communicate with a legacy radio data system. We want to migrate the java side of the system to a VMware Server virtual machine. We've had great success using Moxa DE-303 and 5610 serial over Ethernet appliances and virtual machines for running hylafax. The OS (Linux in this case) uses a kernel driver to communicate with the Moxa via a virtual serial port such as /dev/ttyr00. I want to do the same thing with javax.comm or gnu.io to connect to a virtual serial port. However I'm hitting road blocks everywhere. javax.comm for Linux sees the virtual port, but there are transmission errors. Tried Solaris too, but the Solaris Moxa drivers don't play nice with javax.comm because the driver uses /dev/pts/n instead of /dev/term/x. Next I tried RXTX on Linux, but I'm getting NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX on Solaris. Has anyone used RXTX with serial over Ethernet devices? Any hints on how to make it work? I know that I'm not completely off track because javax.comm does work with Moxa on a Windows platform, but that's just not an option for production deployment. -- Jeff From tjarvi at qbang.org Sat Apr 19 21:08:41 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 19 Apr 2008 21:08:41 -0600 (MDT) Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: yOn Sat, 19 Apr 2008, Jeff Larsen wrote: > Hi all, > > I've been using javax.comm for years to communicate with a legacy > radio data system. We want to migrate the java side of the system to a > VMware Server virtual machine. We've had great success using Moxa > DE-303 and 5610 serial over Ethernet appliances and virtual machines > for running hylafax. The OS (Linux in this case) uses a kernel driver > to communicate with the Moxa via a virtual serial port such as > /dev/ttyr00. > > I want to do the same thing with javax.comm or gnu.io to connect to a > virtual serial port. However I'm hitting road blocks everywhere. > javax.comm for Linux sees the virtual port, but there are transmission > errors. Tried Solaris too, but the Solaris Moxa drivers don't play > nice with javax.comm because the driver uses /dev/pts/n instead of > /dev/term/x. Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris. > > Has anyone used RXTX with serial over Ethernet devices? Any hints on > how to make it work? > > I know that I'm not completely off track because javax.comm does work > with Moxa on a Windows platform, but that's just not an option for > production deployment. > > Moxa should work under linux. There may be minor issues depending upon how complete the kernel driver is but I think it will work. One of the minor issues is /dev/ttyr00 is not enumerated. There are several work arounds documented with the source code and on the wiki. The easiest solution for testing purposes is to make a symbolic link from /dev/ttyr00 to a port that is enumerated such as /dev/ttyS129. You can later alter the rxtx source or use properties to change the enumerated ports. -- Trent Jarvi tjarvi at qbang.org From d.tonhofer at m-plify.com Sun Apr 20 03:33:30 2008 From: d.tonhofer at m-plify.com (David Tonhofer (M-PLIFY S.A.)) Date: Sun, 20 Apr 2008 11:33:30 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: <480B0DEA.5010908@m-plify.com> Jeff Larsen wrote: > Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris It might be that the Java side of RXTX does not recognize that portname. Trying modifying src/RXTXCommDriver.java as described in this case: http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card From ajmas at sympatico.ca Sun Apr 20 16:37:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Apr 2008 18:37:59 -0400 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <480B0DEA.5010908@m-plify.com> References: <480B0DEA.5010908@m-plify.com> Message-ID: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > Jeff Larsen wrote: >> Next I tried RXTX on Linux, but I'm getting >> NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX >> on Solaris > It might be that the Java side of RXTX does not recognize that > portname. > Trying modifying src/RXTXCommDriver.java as described in this case: > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card I wonder whether it would be worth allowing custom port prefixes as a system parameter? For example: gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" Andre From Martin.Oberhuber at windriver.com Tue Apr 22 12:34:36 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 22 Apr 2008 20:34:36 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> References: <480B0DEA.5010908@m-plify.com> <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE6485848056CD6CE@ism-mail03.corp.ad.wrs.com> Sounds like a great idea... I'm wondering how the "variable part" after the Prefixes could be specified though? What about allowing Regular Expression character Classes in the existing System Property for specifying ports: System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyS[0-9],ttyS[ABC],ttyUSB[0-9a-z]"); The set of allowed patterns would of course need to Be restricted compared to REGEX, because it must be A syntax that supports iterating over it. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Montag, 21. April 2008 00:38 > To: rxtx at qbang.org and Users > Subject: Re: [Rxtx] Moxa serial over Ethernet driver > > > On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > > Jeff Larsen wrote: > >> Next I tried RXTX on Linux, but I'm getting > >> NoSuchPortException connecting to /dev/ttyr00. I have yet > to try RXTX > >> on Solaris > > It might be that the Java side of RXTX does not recognize that > > portname. > > Trying modifying src/RXTXCommDriver.java as described in this case: > > > > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_ > SST-4P.2FLP_multiport_card > > I wonder whether it would be worth allowing custom port > prefixes as a > system parameter? For > example: > > gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Loi.TRAN at weatherford.com Tue Apr 22 13:10:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Tue, 22 Apr 2008 14:10:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled Message-ID: Hi, I'm currently using the Java RXTX API to interface to a serial port. The serial port is connected to a bridge board that communicates with our communications system running at 1.875 Mbps which is linked to an embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no flow control). I send a command to the embedded board through the serial-bridge board which then is relayed to the embedded board. The command sent asks the embedded board to dump a binary image. Here's where I'm hitting some problems. I've successfully done this is an integrated serial port from the laptop. The binary file that comes back is consistent on every attempt. When I use the application I've written to do the same thing with a USB-to-serial adapter, the image I get back is not the same as the image I receive through the USB-to-serial adapter is not consistent at all. A final thing is that when I use a terminal program to dump the binary image with the USB-serial adapter, the image is correct. Every time! What is the terminal program doing that's not being done in my application? My application is quite simple. Has anyone observed this behavior before? If you have, I'd like to know how you've gotten around this problem. Thanks, LT =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From tjarvi at qbang.org Tue Apr 22 21:11:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 22 Apr 2008 21:11:10 -0600 (MDT) Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org From Loi.TRAN at weatherford.com Wed Apr 23 08:35:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Wed, 23 Apr 2008 09:35:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: Thanks for all the responses. I finally tried something that worked consistently. I updated my Prolific driver and repeated my tests. It worked. If you're using the Prolific type USB-serial adapters, do no use the Prolific version 2.0.2.1 driver on Windows. Update it to the latest 2.0.2.8 version. Again, thanks for all the responses. LT -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Tuesday, April 22, 2008 10:11 PM To: TRAN, Loi X. Cc: rxtx at qbang.org Subject: Re: [Rxtx] Prolific USB - RXTX data mangled On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From Martin.Oberhuber at windriver.com Wed Apr 23 18:54:26 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 02:54:26 +0200 Subject: [Rxtx] RXTX port locking on Linux status? Message-ID: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Dear RXTX community, I'm wondering what the status is with RXTX locking serial ports on Linux? My understanding is that the mechanism used in 2.1-7r2 (lockfiles) is not really state of the art, and has lots of problems (e.g. missing permissions). There was an idea to migrate towards a Kernel syscall based solution for port locking. What's the status here? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/9878db9f/attachment-0026.html From tjarvi at qbang.org Wed Apr 23 20:32:24 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Apr 2008 20:32:24 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > Dear RXTX community, > > I'm wondering what the status is with RXTX locking > serial ports on Linux? > > My understanding is that the mechanism used in > 2.1-7r2 (lockfiles) is not really state of the art, and > has lots of problems (e.g. missing permissions). > > There was an idea to migrate towards a Kernel > syscall based solution for port locking. > > What's the status here? > Hi Martin, I'm in favor of deprecating the current FHS locking mechanism in favor of an IOCTL when available. I think it will be available on all the platforms but do not know for sure. The status is unchanged. I've had very few free cycles for such things. Feel free to take a stab at it if you have some time. I believe the IOCTL is used in the Mac OS X code already. I don't see any real backwards compatability issues and the IOCTL should just work. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Apr 24 06:14:06 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 14:14:06 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Thanks Trent. Problem is only that I'm really not at all Familiar with the C part of RXTX. If there Were anything I could do in Java for this, It would be easier for me.... ... Are there any C experts here on the list Who'd like to look at ioctl port locking For linux? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Donnerstag, 24. April 2008 04:32 > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > I'm wondering what the status is with RXTX locking > > serial ports on Linux? > > > > My understanding is that the mechanism used in > > 2.1-7r2 (lockfiles) is not really state of the art, and > > has lots of problems (e.g. missing permissions). > > > > There was an idea to migrate towards a Kernel > > syscall based solution for port locking. > > > > What's the status here? > > > > Hi Martin, > > I'm in favor of deprecating the current FHS locking mechanism > in favor of > an IOCTL when available. I think it will be available on all the > platforms but do not know for sure. > > The status is unchanged. I've had very few free cycles for > such things. > Feel free to take a stab at it if you have some time. I > believe the IOCTL > is used in the Mac OS X code already. > > I don't see any real backwards compatability issues and the > IOCTL should > just work. > > -- > Trent Jarvi > tjarvi at qbang.org > From sspies at sloc.de Thu Apr 24 07:15:36 2008 From: sspies at sloc.de (Sebastian Spies) Date: Thu, 24 Apr 2008 15:15:36 +0200 (CEST) Subject: [Rxtx] rxtx on gumstix: Interrupted system call In-Reply-To: <47FB7B20.7080504@sloc.de> References: <47FB7B20.7080504@sloc.de> Message-ID: <55445.130.83.139.205.1209042936.squirrel@ssl.sloc.de> Dear list, while porting rxtx to the gumstix, I found out, that select used in readArray in SerialImp.c might not work as expected. Maybe, because of missing TIOCSERGETLSR-support? select is often interrupted, so i wrote the following quick'n'dirty hack to make it work on gumstix: diff -Nur rxtx-2.1-7r2/src/SerialImp.c rxtx-2.1-7r2/src/SerialImp.c --- rxtx-2.1-7r2/src/SerialImp.c 2006-01-29 23:19:04.000000000 +0100 +++ rxtx-2.1-7r2-patched/src/SerialImp.c 2008-04-24 14:30:17.000000000 +0200 @@ -3380,7 +3381,7 @@ JNIEXPORT jint JNICALL RXTXPort(readArray)( JNIEnv *env, jobject jobj, jbyteArray jbarray, jint offset, jint length ) { - int bytes; + int bytes = 0; jbyte *body; /* char msg[80]; */ int fd = get_java_var( env, jobj, "fd", "I" ); @@ -3397,9 +3398,18 @@ "readArray", "Invalid length" ); return -1; } - body = (*env)->GetByteArrayElements( env, jbarray, 0 ); - bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ - (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + while(1 > bytes) + { + body = (*env)->GetByteArrayElements( env, jbarray, 0 ); + bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ + (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + // quick'n'dirty - SSP + report (" trying again... \n"); + errno = 0; + } + if( bytes < 0 ) { report( "RXTXPort:readArray bytes < 0" ); LEAVE( "RXTXPort:readArray" ); > Hey, > > I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use > RXTXPort$SerialInputStream.read(), then I get the following Exception. I > did not yet figure out which system call is interrupted as strace > produces loads of output. > > Any help would be very appreciated. Thanks in advance. > Sebastian > > > [java] java.io.IOException: Interrupted system call in readArray > [java] at gnu.io.RXTXPort.readArray(Native Method) > [java] at > gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) > [java] at > java.io.FilterInputStream.read(FilterInputStream.java:189) > [java] at > java.io.BufferedInputStream.refill(BufferedInputStream.java:371) > [java] at > java.io.BufferedInputStream.read(BufferedInputStream.java:229) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) > [java] at > com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) > > -- > Sebastian Spies > > mail: sspies at sloc.de > > > > From fire_baptized at hotmail.com Thu Apr 24 18:27:48 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Thu, 24 Apr 2008 20:27:48 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hello I am having a problem with the serial device connecting (software wise) to the serial port. However I have a test program and it seems to work just fine in that environment - and it doesnt use GUI. The error I am getting is : PortNotFoundException Now the way I have it setup in the GUI environment is that once the user pushes a JButton the program connects using this class: protected void establishConnection() { try { portId = CommPortIdentifier.getPortIdentifier("COM3"); System.out.println("Establishing connction....."); messages[0] = "\nEstablishing connction.....\n"; } catch ( NoSuchPortException noport) { System.out.println("Port not found: "+ noport); messages[0] = "Port not found: "+ noport+"\n"; } try { serialPort = (SerialPort) portId.open("serial", 50); System.out.println("Port has been found."); messages[1] = "Port has been found.\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[1] = "" +usedport; } try { serialPort = (SerialPort) portId.open("serial", 50); messages[2] = "Connecting to COM3 on port 50....\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; } try { serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); System.out.println("Esablishing the transfer rate settings for COM3."); messages[3] = "Esablishing the transfer rate settings for COM3.\n"; } catch (UnsupportedCommOperationException nosupcom) { System.out.println(nosupcom); System.out.println("The tranfer rate could not be esblished on COM3."); messages[3] = "The tranfer rate could not be esblished on COM3.\n"; } System.out.println(serialPort.getFlowControlMode()); messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; //sendDataOut(buffer[3],buffer[4]); } I need all the data in this method (and all the string values in this method) to be printed out on a JTextArea. I wont do me any good if not all the text is printed on a JTextArea in another class. So I have the text printing the JTextArea correctly, but everytime the JButton is activated - it gives me that error message. I did add a disconnect button that is supposed to call the serialPort.close(). _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/273fd4ec/attachment-0025.html From tjarvi at qbang.org Thu Apr 24 21:54:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Apr 2008 21:54:10 -0600 (MDT) Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > Hello I am having a problem with the serial device connecting (software > wise) to the serial port. However I have a test program and it seems to > work just fine in that environment - and it doesnt use GUI. The error I > am getting is : PortNotFoundException Now the way I have it setup in the > GUI environment is that once the user pushes a JButton the program > connects using this class: > > protected void establishConnection() { > try { > portId = CommPortIdentifier.getPortIdentifier("COM3"); > System.out.println("Establishing connction....."); > messages[0] = "\nEstablishing connction.....\n"; > } > catch ( NoSuchPortException noport) { > System.out.println("Port not found: "+ noport); > messages[0] = "Port not found: "+ noport+"\n"; > } > try { > serialPort = (SerialPort) portId.open("serial", 50); > System.out.println("Port has been found."); > messages[1] = "Port has been found.\n"; > } > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[1] = "" +usedport; > } ================================================================= > try { > serialPort = (SerialPort) portId.open("serial", 50); > messages[2] = "Connecting to COM3 on port 50....\n"; > } ================================================================== > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > } > try { > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > System.out.println("Esablishing the transfer rate settings for COM3."); > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > } > catch (UnsupportedCommOperationException nosupcom) { > System.out.println(nosupcom); > System.out.println("The tranfer rate could not be esblished on COM3."); > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > } > System.out.println(serialPort.getFlowControlMode()); > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > //sendDataOut(buffer[3],buffer[4]); > } > > I need all the data in this method (and all the string values in this > method) to be printed out on a JTextArea. I wont do me any good if not > all the text is printed on a JTextArea in another class. So I have the > text printing the JTextArea correctly, but everytime the JButton is > activated - it gives me that error message. I did add a disconnect > button that is supposed to call the serialPort.close(). > The open code used twice is going to throw an exception. It may be that you catch the exception above this code and print a confusing message? A common mistake is people will accidently run two copies of their program. The first instance of the program will open the port and prevent enumeration (finding the port) in the second instance of the program. As an example, you may be running your text based application which is preventing the GUI from seeing the port. Enumeration is done by trying to open the port. If the port is open, Enumeration fails. -- Trent Jarvi tjarvi at qbang.org From fire_baptized at hotmail.com Thu Apr 24 22:32:05 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 00:32:05 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Wow - thanks dude what a dumb thing for me to not catch..... now here is the current problem - right now I am trying to output data again one is with the test program - and it seems that serialPort.setRTS(true); is throwing an exceptions there - now if I show this code please bare in mind that I am only testing - the code is kinda sloppy in my mind - but if I can figure out why calling this function is throwing an exception then maybe I can figure out why my GUI application is getting the same null pointer exceptions when try to send out the data stream. FYI Trent this email is not directed towards you - anyone can jump in on this public static void main(String args[]) { byte[] b = new byte[64]; int keyinput = 0 ; byte x = 0; byte y = 0; PortTesting1 testports = new PortTesting1(); try { joyskoro = Joystick.createInstance(); } catch (IOException ioexc) { System.out.println("There is an input/output problem: " + ioexc); } while (true) { joyskoro.poll(); b[0] = ((byte) -(10 * joyskoro.getY())); b[1] = ((byte) (10 * joyskoro.getX())); System.out.println("The 3rd byte is: " +b[0]); System.out.println("The 4rd byte is: " +b[1]); serialPort.setRTS(true); // HERE IS WHERE THE PROBLEM IS !!!!!!! ON THIS LINE but if I dont have it active in my program the Bluetooth device (that is System.out.println("Ready to send :-) !"); //connected to the serial port does not send out data!!!!! if (joyskoro.isButtonDown(joyskoro.BUTTON10)) { System.out.println("Connection terminated."); serialPort.close(); break; } if (joyskoro.isButtonDown(joyskoro.BUTTON2)) { boolean flag = true; //reading from key input from the keyboard System.out.println("Please input a command: "); while (flag) { try { keyinput = System.in.read(); } catch (IOException ioexc) {/*there is no need to put * anything here */ } if((char)keyinput=='w') { pushIt((byte)85); } if((char)keyinput=='s') { pushIt((byte)84); } if((char)keyinput=='a') { pushIt((byte)83); } if((char)keyinput=='d') { pushIt((byte)82); } if((char)keyinput=='q') { pushIt((byte)89); } if((char)keyinput=='\t') { //this stop reading input from the keyboard flag = false; } } and help anyways here is the block of code that throwing an exception for the test program: > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/5c8f7d68/attachment-0025.html From fire_baptized at hotmail.com Fri Apr 25 07:59:53 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 09:59:53 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Are there any examples of how to push out data? As in using input and output streams - if I can compare code maybe I can see where this is causing a problem. I have a byte array that I am pushing out data. I keep getting null pointer exceptions every where I turn. > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/22228ab6/attachment-0024.html From ajmas at sympatico.ca Sat Apr 26 07:37:09 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 26 Apr 2008 09:37:09 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hi, On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote: > > Are there any examples of how to push out data? As in using input > and output streams - if I can compare code maybe I can see where > this is causing a problem. I have a byte array that I am pushing > out data. I keep getting null pointer exceptions every where I turn. > There are some examples here that might be of help: http://rxtx.qbang.org/wiki/index.php/Examples Andre From fire_baptized at hotmail.com Sat Apr 26 20:13:54 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Sat, 26 Apr 2008 22:13:54 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: looked at those....yep didnt help - I need to push out data with GUI and not get a null pointer exception everytime I try. > CC: rxtx at qbang.org> From: ajmas at sympatico.ca> To: fire_baptized at hotmail.com> Subject: Re: [Rxtx] Serial Problems with Gui.....> Date: Sat, 26 Apr 2008 09:37:09 -0400> > Hi,> > > On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote:> >> > Are there any examples of how to push out data? As in using input > > and output streams - if I can compare code maybe I can see where > > this is causing a problem. I have a byte array that I am pushing > > out data. I keep getting null pointer exceptions every where I turn.> >> > There are some examples here that might be of help:> > http://rxtx.qbang.org/wiki/index.php/Examples> > Andre _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080426/09f95b41/attachment-0023.html From michael.erskine at ketech.com Mon Apr 28 02:47:22 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 28 Apr 2008 09:47:22 +0100 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D426EF3CBBC5@no-sv-03.ketech.local> Jesrael D. Summerhill wrote: > looked at those....yep didnt help - I need to push out data with GUI and > not get a null pointer exception everytime I try. So it seems pretty obvious that your code needs to check for nulls wherever one may occur and report what's happening. Alternatively, catch the npe and display the stack trace. Then you can fix your code so it doesn't try to work with something that ain't there. Regards, Michael Erskine. From scldad at sdc.com.au Mon Apr 28 03:58:34 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Mon, 28 Apr 2008 19:28:34 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Message-ID: <200804281928.34454.scldad@sdc.com.au> Has anybody done any design work on this? The first thing that springs to mind is that we still need to check for lock files because other apps tend to use that approach even if we go to ioctl. Cheers, Stephen Davies On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > Thanks Trent. > > Problem is only that I'm really not at all > Familiar with the C part of RXTX. If there > Were anything I could do in Java for this, > It would be easier for me.... > > ... Are there any C experts here on the list > Who'd like to look at ioctl port locking > For linux? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > -----Original Message----- > > From: Trent Jarvi [mailto:tjarvi at qbang.org] > > Sent: Donnerstag, 24. April 2008 04:32 > > To: Oberhuber, Martin > > Cc: rxtx at qbang.org > > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > > > I'm wondering what the status is with RXTX locking > > > serial ports on Linux? > > > > > > My understanding is that the mechanism used in > > > 2.1-7r2 (lockfiles) is not really state of the art, and > > > has lots of problems (e.g. missing permissions). > > > > > > There was an idea to migrate towards a Kernel > > > syscall based solution for port locking. > > > > > > What's the status here? > > > > Hi Martin, > > > > I'm in favor of deprecating the current FHS locking mechanism > > in favor of > > an IOCTL when available. I think it will be available on all the > > platforms but do not know for sure. > > > > The status is unchanged. I've had very few free cycles for > > such things. > > Feel free to take a stab at it if you have some time. I > > believe the IOCTL > > is used in the Mac OS X code already. > > > > I don't see any real backwards compatability issues and the > > IOCTL should > > just work. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Mon Apr 28 04:21:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 28 Apr 2008 04:21:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804281928.34454.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: I don't think there would need to be any architectural changes. A couple ifdefs and minor changes in the current code should be enough. Proposal: FHS/UUCP locks: continue to respect them, try to create them but do not error if the IOCTL is supported. (But does the IOCTL being defined mean it will work?) Enumeration: Do not assert the IOCTL while opening. Serial.open: assert the IOCTL after open. Continue to use locks as described above after asserting the IOCTL. If the IOCTL is defined but not working, handle it here. Failure cases include the IOCTL is not supported and the port is already locked. On Mon, 28 Apr 2008, Stephen Davies wrote: > Has anybody done any design work on this? > The first thing that springs to mind is that we still need to check for lock > files because other apps tend to use that approach even if we go to ioctl. > > Cheers, > Stephen Davies > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: >> Thanks Trent. >> >> Problem is only that I'm really not at all >> Familiar with the C part of RXTX. If there >> Were anything I could do in Java for this, >> It would be easier for me.... >> >> ... Are there any C experts here on the list >> Who'd like to look at ioctl port locking >> For linux? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >>> -----Original Message----- >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] >>> Sent: Donnerstag, 24. April 2008 04:32 >>> To: Oberhuber, Martin >>> Cc: rxtx at qbang.org >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? >>> >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: >>>> Dear RXTX community, >>>> >>>> I'm wondering what the status is with RXTX locking >>>> serial ports on Linux? >>>> >>>> My understanding is that the mechanism used in >>>> 2.1-7r2 (lockfiles) is not really state of the art, and >>>> has lots of problems (e.g. missing permissions). >>>> >>>> There was an idea to migrate towards a Kernel >>>> syscall based solution for port locking. >>>> >>>> What's the status here? >>> >>> Hi Martin, >>> >>> I'm in favor of deprecating the current FHS locking mechanism >>> in favor of >>> an IOCTL when available. I think it will be available on all the >>> platforms but do not know for sure. >>> >>> The status is unchanged. I've had very few free cycles for >>> such things. >>> Feel free to take a stab at it if you have some time. I >>> believe the IOCTL >>> is used in the Mac OS X code already. >>> >>> I don't see any real backwards compatability issues and the >>> IOCTL should >>> just work. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Tue Apr 29 12:04:04 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Apr 2008 20:04:04 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Hi all, The biggest problem that I have seen with lockfiles on Linux At least is, that it seems there is no standard with respect To the folder in which they should be created. Also, many Distributions seem to set up file system permissions in such A way that writing to the lockfile folder is not allowed for The normal user -- that's why we stopped using lockfiles In our commercial product. If we are to still respect lockfiles, we first need to Understand where we are expected to look for them. Does Anybody have any insight what variants of lockfile folder Schema exist out there in the wild? Some apps like minicom Seem to even allow users to manually specify a lockfile Folder of their choice. Because of the difficulty finding the right lockfile folder, And because of the inherent risk of thinking that something Might be locked while it actually isn't, I'd suggest that RXTX should have a "soft-off" feature that allows disabling ALL Lockfile checks at runtime without recompiling the native Sharedlibs. Trent - I like your strategy outline, but I think that it Needs to be configurable by the client such that users and/or Customer Support can disable lockfiles / disable ioctl in Case they detect that they are runing on an OS / Kernal that Does not support one or the other. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Montag, 28. April 2008 12:22 > To: Stephen Davies > Cc: rxtx at qbang.org; Oberhuber, Martin; Trent Jarvi > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > I don't think there would need to be any architectural > changes. A couple > ifdefs and minor changes in the current code should be enough. > > Proposal: > > FHS/UUCP locks: > continue to respect them, try to create them but do not error if > the IOCTL is supported. (But does the IOCTL being defined mean > it will work?) > Enumeration: > Do not assert the IOCTL while opening. > Serial.open: > assert the IOCTL after open. Continue to use locks as described > above after asserting the IOCTL. If the IOCTL is defined but > not working, handle it here. Failure cases include the IOCTL > is not supported and the port is already locked. > > On Mon, 28 Apr 2008, Stephen Davies wrote: > > > Has anybody done any design work on this? > > The first thing that springs to mind is that we still need > to check for lock > > files because other apps tend to use that approach even if > we go to ioctl. > > > > Cheers, > > Stephen Davies > > > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > >> Thanks Trent. > >> > >> Problem is only that I'm really not at all > >> Familiar with the C part of RXTX. If there > >> Were anything I could do in Java for this, > >> It would be easier for me.... > >> > >> ... Are there any C experts here on the list > >> Who'd like to look at ioctl port locking > >> For linux? > >> > >> Thanks, > >> -- > >> Martin Oberhuber, Senior Member of Technical Staff, Wind River > >> Target Management Project Lead, DSDP PMC Member > >> http://www.eclipse.org/dsdp/tm > >> > >>> -----Original Message----- > >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] > >>> Sent: Donnerstag, 24. April 2008 04:32 > >>> To: Oberhuber, Martin > >>> Cc: rxtx at qbang.org > >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? > >>> > >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > >>>> Dear RXTX community, > >>>> > >>>> I'm wondering what the status is with RXTX locking > >>>> serial ports on Linux? > >>>> > >>>> My understanding is that the mechanism used in > >>>> 2.1-7r2 (lockfiles) is not really state of the art, and > >>>> has lots of problems (e.g. missing permissions). > >>>> > >>>> There was an idea to migrate towards a Kernel > >>>> syscall based solution for port locking. > >>>> > >>>> What's the status here? > >>> > >>> Hi Martin, > >>> > >>> I'm in favor of deprecating the current FHS locking mechanism > >>> in favor of > >>> an IOCTL when available. I think it will be available on all the > >>> platforms but do not know for sure. > >>> > >>> The status is unchanged. I've had very few free cycles for > >>> such things. > >>> Feel free to take a stab at it if you have some time. I > >>> believe the IOCTL > >>> is used in the Mac OS X code already. > >>> > >>> I don't see any real backwards compatability issues and the > >>> IOCTL should > >>> just work. > >>> > >>> -- > >>> Trent Jarvi > >>> tjarvi at qbang.org > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > From Steffen.DETTMER at ingenico.com Tue Apr 29 13:34:44 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 29 Apr 2008 21:34:44 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Message-ID: <20080429193444.GU2928@elberon.bln.de.ingenico.com> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > The biggest problem that I have seen with lockfiles on Linux > At least is, that it seems there is no standard with respect > To the folder in which they should be created. Also, many > Distributions seem to set up file system permissions in such > A way that writing to the lockfile folder is not allowed for > The normal user -- that's why we stopped using lockfiles > In our commercial product. It seems it depends on the expectations. I consider it as a feature that by default a linux user cannot access serial ports. Maybe root connected a modem (can produce phone bills) or even some serial card reader, maybe with the web servers key pair. I would expect that by default a user cannot open the serial port because of insufficient permissions on the device file. I would expect this on other unices as well (but I don't know it). For windows I think it should be similar but not impacting so much in practice, because often windows users work with big permissions on a somewhat high priviledge level or even Administrator. > If we are to still respect lockfiles, we first need to > Understand where we are expected to look for them. Does > Anybody have any insight what variants of lockfile folder > Schema exist out there in the wild? Some apps like minicom > Seem to even allow users to manually specify a lockfile > Folder of their choice. At least my (ancient) minicom does not allow the user to change this option, it is displayed but read-only, but root is allowed to change it. > Because of the difficulty finding the right lockfile folder, > And because of the inherent risk of thinking that something > Might be locked while it actually isn't, I'd suggest that > RXTX should have a "soft-off" feature that allows disabling > ALL Lockfile checks at runtime without recompiling the native > Sharedlibs. sounds very reasonable, yes... and as admin I would not wish that users could skip such locking because they do things wrong by default ;) (in the end I guess that is related to the dilemma, that hotplug/user-owned-periphery and multi-user systems simply conflict) > Trent - I like your strategy outline, but I think that it > Needs to be configurable by the client such that users and/or > Customer Support can disable lockfiles / disable ioctl in > Case they detect that they are runing on an OS / Kernal that > Does not support one or the other. Yes, this would be good I guess... Applications could offer configuration options to control that, maybe similarily as minicom. BTW, man minicom tells: *B - Lock file location On most systems This should be /usr/spool/uucp. Linux systems use /var/lock. If this directory does not exist, minicom will not attempt to use lockfiles. The statement `Linux systems use /var/lock' is interesting, does anyone know the source of this convention? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Tue Apr 29 16:11:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Apr 2008 16:11:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? These details are outlined in the Filesystem Hierarchy Standard (FHS). http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLOCKLOCKFILES -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Tue Apr 29 18:58:09 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Wed, 30 Apr 2008 10:28:09 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: <200804301028.09307.scldad@sdc.com.au> I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is the same. Any ideas as to how to handle this? Stephen On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: > * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > > The biggest problem that I have seen with lockfiles on Linux > > At least is, that it seems there is no standard with respect > > To the folder in which they should be created. Also, many > > Distributions seem to set up file system permissions in such > > A way that writing to the lockfile folder is not allowed for > > The normal user -- that's why we stopped using lockfiles > > In our commercial product. > > It seems it depends on the expectations. I consider it as a > feature that by default a linux user cannot access serial ports. > Maybe root connected a modem (can produce phone bills) or even > some serial card reader, maybe with the web servers key pair. > > I would expect that by default a user cannot open the serial port > because of insufficient permissions on the device file. I would > expect this on other unices as well (but I don't know it). > > For windows I think it should be similar but not impacting so > much in practice, because often windows users work with big > permissions on a somewhat high priviledge level or even > Administrator. > > > If we are to still respect lockfiles, we first need to > > Understand where we are expected to look for them. Does > > Anybody have any insight what variants of lockfile folder > > Schema exist out there in the wild? Some apps like minicom > > Seem to even allow users to manually specify a lockfile > > Folder of their choice. > > At least my (ancient) minicom does not allow the user to change > this option, it is displayed but read-only, but root is allowed > to change it. > > > Because of the difficulty finding the right lockfile folder, > > And because of the inherent risk of thinking that something > > Might be locked while it actually isn't, I'd suggest that > > RXTX should have a "soft-off" feature that allows disabling > > ALL Lockfile checks at runtime without recompiling the native > > Sharedlibs. > > sounds very reasonable, yes... > and as admin I would not wish that users could skip such > locking because they do things wrong by default ;) > > (in the end I guess that is related to the dilemma, that > hotplug/user-owned-periphery and multi-user systems simply > conflict) > > > Trent - I like your strategy outline, but I think that it > > Needs to be configurable by the client such that users and/or > > Customer Support can disable lockfiles / disable ioctl in > > Case they detect that they are runing on an OS / Kernal that > > Does not support one or the other. > > Yes, this would be good I guess... Applications could offer > configuration options to control that, maybe similarily as > minicom. > > BTW, man minicom tells: > > *B - Lock file location > On most systems This should be /usr/spool/uucp. > Linux systems use /var/lock. If this directory > does not exist, minicom will not attempt to use > lockfiles. > > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure > and expedient electronic transaction acceptance. Ingenico products leverage > proven technology, established standards and unparalleled ergonomics to > provide optimal reliability, versatility and usability. This comprehensive > range of products is complemented by a global array of services and > partnerships, enabling businesses in a number of vertical sectors to accept > transactions anywhere their business takes them. www.ingenico.com This > message may contain confidential and/or privileged information. If you are > not the addressee or authorized to receive this for the addressee, you must > not use, copy, disclose or take any action based on this message or any > information herein. If you have received this message in error, please > advise the sender immediately by reply e-mail and delete this message. > Thank you for your cooperation. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Wed Apr 30 19:30:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 30 Apr 2008 19:30:51 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804301028.09307.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> <200804301028.09307.scldad@sdc.com.au> Message-ID: Hi Stephen, I suspect ioctl/TIOCEXCL open/O_EXCL would do the job. Mac uses TIOCEXCL and it is POSIX. We use O_EXCL for lockfiles on Linux already. On Wed, 30 Apr 2008, Stephen Davies wrote: > I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is > the same. > > Any ideas as to how to handle this? > > Stephen > > > On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: >> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: >>> The biggest problem that I have seen with lockfiles on Linux >>> At least is, that it seems there is no standard with respect >>> To the folder in which they should be created. Also, many >>> Distributions seem to set up file system permissions in such >>> A way that writing to the lockfile folder is not allowed for >>> The normal user -- that's why we stopped using lockfiles >>> In our commercial product. >> >> It seems it depends on the expectations. I consider it as a >> feature that by default a linux user cannot access serial ports. >> Maybe root connected a modem (can produce phone bills) or even >> some serial card reader, maybe with the web servers key pair. >> >> I would expect that by default a user cannot open the serial port >> because of insufficient permissions on the device file. I would >> expect this on other unices as well (but I don't know it). >> >> For windows I think it should be similar but not impacting so >> much in practice, because often windows users work with big >> permissions on a somewhat high priviledge level or even >> Administrator. >> >>> If we are to still respect lockfiles, we first need to >>> Understand where we are expected to look for them. Does >>> Anybody have any insight what variants of lockfile folder >>> Schema exist out there in the wild? Some apps like minicom >>> Seem to even allow users to manually specify a lockfile >>> Folder of their choice. >> >> At least my (ancient) minicom does not allow the user to change >> this option, it is displayed but read-only, but root is allowed >> to change it. >> >>> Because of the difficulty finding the right lockfile folder, >>> And because of the inherent risk of thinking that something >>> Might be locked while it actually isn't, I'd suggest that >>> RXTX should have a "soft-off" feature that allows disabling >>> ALL Lockfile checks at runtime without recompiling the native >>> Sharedlibs. >> >> sounds very reasonable, yes... >> and as admin I would not wish that users could skip such >> locking because they do things wrong by default ;) >> >> (in the end I guess that is related to the dilemma, that >> hotplug/user-owned-periphery and multi-user systems simply >> conflict) >> >>> Trent - I like your strategy outline, but I think that it >>> Needs to be configurable by the client such that users and/or >>> Customer Support can disable lockfiles / disable ioctl in >>> Case they detect that they are runing on an OS / Kernal that >>> Does not support one or the other. >> >> Yes, this would be good I guess... Applications could offer >> configuration options to control that, maybe similarily as >> minicom. >> >> BTW, man minicom tells: >> >> *B - Lock file location >> On most systems This should be /usr/spool/uucp. >> Linux systems use /var/lock. If this directory >> does not exist, minicom will not attempt to use >> lockfiles. >> >> The statement `Linux systems use /var/lock' is interesting, does >> anyone know the source of this convention? >> >> oki, >> >> Steffen >> >> About Ingenico Throughout the world businesses rely on Ingenico for secure >> and expedient electronic transaction acceptance. Ingenico products leverage >> proven technology, established standards and unparalleled ergonomics to >> provide optimal reliability, versatility and usability. This comprehensive >> range of products is complemented by a global array of services and >> partnerships, enabling businesses in a number of vertical sectors to accept >> transactions anywhere their business takes them. www.ingenico.com This >> message may contain confidential and/or privileged information. If you are >> not the addressee or authorized to receive this for the addressee, you must >> not use, copy, disclose or take any action based on this message or any >> information herein. If you have received this message in error, please >> advise the sender immediately by reply e-mail and delete this message. >> Thank you for your cooperation. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0049.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0047.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0034.html From pboulton at pulsetracer.com Fri Apr 18 14:30:13 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Fri, 18 Apr 2008 13:30:13 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site Message-ID: <480904D5.1060307@pulsetracer.com> Hello, gentle serial porters. I have downloaded the zipped up binaries for use on Windows without Sun's CommAPI, but don't seem able to extract anything from the download. Go to main page, http://www.rxtx.org/ Click on Downloads I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) And I save it to disk. If I try and extract the files with WinZip, Winzip thinks the archive is corrupt. If I try using Windows Explorer, I am able to extract it into a single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than the original .zip. Any help would be much appreciated. Sincerely, Philip Boulton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080418/97d89793/attachment-0032.html From tjarvi at qbang.org Fri Apr 18 19:07:00 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 18 Apr 2008 19:07:00 -0600 (MDT) Subject: [Rxtx] Difficulty opening zip file at rxtx site In-Reply-To: <480904D5.1060307@pulsetracer.com> References: <480904D5.1060307@pulsetracer.com> Message-ID: On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org From pboulton at pulsetracer.com Sat Apr 19 12:46:26 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Sat, 19 Apr 2008 11:46:26 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site References: <480904D5.1060307@pulsetracer.com> Message-ID: <53DB7576450695419E09299104043761A78533@ZTGSERVER.ztg.local> I have been able to get my hands on the binaries, by going to the ftp directory /pub/rxtx at ftp.qbang.org,, and ftping the file rxtx-2.1-7-bins-r2.zip . This opens happily with Winzip, and extracts as the set of files that you describe below. I only experience the ill-formed archive problem by clicking the link on the rxtx.org Downloads page (http://rxtx.qbang.org/pub/rxtx/ rxtx-2.1-7-bins-r2.zip ). Not sure what to make of that. Philip Boulton ________________________________ From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Fri 4/18/2008 6:07 PM To: Philip Boulton Cc: rxtx at qbang.org Subject: Re: [Rxtx] Difficulty opening zip file at rxtx site On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080419/147923bb/attachment-0031.html From jlar310 at gmail.com Sat Apr 19 19:11:55 2008 From: jlar310 at gmail.com (Jeff Larsen) Date: Sat, 19 Apr 2008 20:11:55 -0500 Subject: [Rxtx] Moxa serial over Ethernet driver Message-ID: Hi all, I've been using javax.comm for years to communicate with a legacy radio data system. We want to migrate the java side of the system to a VMware Server virtual machine. We've had great success using Moxa DE-303 and 5610 serial over Ethernet appliances and virtual machines for running hylafax. The OS (Linux in this case) uses a kernel driver to communicate with the Moxa via a virtual serial port such as /dev/ttyr00. I want to do the same thing with javax.comm or gnu.io to connect to a virtual serial port. However I'm hitting road blocks everywhere. javax.comm for Linux sees the virtual port, but there are transmission errors. Tried Solaris too, but the Solaris Moxa drivers don't play nice with javax.comm because the driver uses /dev/pts/n instead of /dev/term/x. Next I tried RXTX on Linux, but I'm getting NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX on Solaris. Has anyone used RXTX with serial over Ethernet devices? Any hints on how to make it work? I know that I'm not completely off track because javax.comm does work with Moxa on a Windows platform, but that's just not an option for production deployment. -- Jeff From tjarvi at qbang.org Sat Apr 19 21:08:41 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 19 Apr 2008 21:08:41 -0600 (MDT) Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: yOn Sat, 19 Apr 2008, Jeff Larsen wrote: > Hi all, > > I've been using javax.comm for years to communicate with a legacy > radio data system. We want to migrate the java side of the system to a > VMware Server virtual machine. We've had great success using Moxa > DE-303 and 5610 serial over Ethernet appliances and virtual machines > for running hylafax. The OS (Linux in this case) uses a kernel driver > to communicate with the Moxa via a virtual serial port such as > /dev/ttyr00. > > I want to do the same thing with javax.comm or gnu.io to connect to a > virtual serial port. However I'm hitting road blocks everywhere. > javax.comm for Linux sees the virtual port, but there are transmission > errors. Tried Solaris too, but the Solaris Moxa drivers don't play > nice with javax.comm because the driver uses /dev/pts/n instead of > /dev/term/x. Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris. > > Has anyone used RXTX with serial over Ethernet devices? Any hints on > how to make it work? > > I know that I'm not completely off track because javax.comm does work > with Moxa on a Windows platform, but that's just not an option for > production deployment. > > Moxa should work under linux. There may be minor issues depending upon how complete the kernel driver is but I think it will work. One of the minor issues is /dev/ttyr00 is not enumerated. There are several work arounds documented with the source code and on the wiki. The easiest solution for testing purposes is to make a symbolic link from /dev/ttyr00 to a port that is enumerated such as /dev/ttyS129. You can later alter the rxtx source or use properties to change the enumerated ports. -- Trent Jarvi tjarvi at qbang.org From d.tonhofer at m-plify.com Sun Apr 20 03:33:30 2008 From: d.tonhofer at m-plify.com (David Tonhofer (M-PLIFY S.A.)) Date: Sun, 20 Apr 2008 11:33:30 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: <480B0DEA.5010908@m-plify.com> Jeff Larsen wrote: > Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris It might be that the Java side of RXTX does not recognize that portname. Trying modifying src/RXTXCommDriver.java as described in this case: http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card From ajmas at sympatico.ca Sun Apr 20 16:37:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Apr 2008 18:37:59 -0400 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <480B0DEA.5010908@m-plify.com> References: <480B0DEA.5010908@m-plify.com> Message-ID: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > Jeff Larsen wrote: >> Next I tried RXTX on Linux, but I'm getting >> NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX >> on Solaris > It might be that the Java side of RXTX does not recognize that > portname. > Trying modifying src/RXTXCommDriver.java as described in this case: > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card I wonder whether it would be worth allowing custom port prefixes as a system parameter? For example: gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" Andre From Martin.Oberhuber at windriver.com Tue Apr 22 12:34:36 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 22 Apr 2008 20:34:36 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> References: <480B0DEA.5010908@m-plify.com> <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE6485848056CD6CE@ism-mail03.corp.ad.wrs.com> Sounds like a great idea... I'm wondering how the "variable part" after the Prefixes could be specified though? What about allowing Regular Expression character Classes in the existing System Property for specifying ports: System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyS[0-9],ttyS[ABC],ttyUSB[0-9a-z]"); The set of allowed patterns would of course need to Be restricted compared to REGEX, because it must be A syntax that supports iterating over it. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Montag, 21. April 2008 00:38 > To: rxtx at qbang.org and Users > Subject: Re: [Rxtx] Moxa serial over Ethernet driver > > > On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > > Jeff Larsen wrote: > >> Next I tried RXTX on Linux, but I'm getting > >> NoSuchPortException connecting to /dev/ttyr00. I have yet > to try RXTX > >> on Solaris > > It might be that the Java side of RXTX does not recognize that > > portname. > > Trying modifying src/RXTXCommDriver.java as described in this case: > > > > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_ > SST-4P.2FLP_multiport_card > > I wonder whether it would be worth allowing custom port > prefixes as a > system parameter? For > example: > > gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Loi.TRAN at weatherford.com Tue Apr 22 13:10:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Tue, 22 Apr 2008 14:10:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled Message-ID: Hi, I'm currently using the Java RXTX API to interface to a serial port. The serial port is connected to a bridge board that communicates with our communications system running at 1.875 Mbps which is linked to an embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no flow control). I send a command to the embedded board through the serial-bridge board which then is relayed to the embedded board. The command sent asks the embedded board to dump a binary image. Here's where I'm hitting some problems. I've successfully done this is an integrated serial port from the laptop. The binary file that comes back is consistent on every attempt. When I use the application I've written to do the same thing with a USB-to-serial adapter, the image I get back is not the same as the image I receive through the USB-to-serial adapter is not consistent at all. A final thing is that when I use a terminal program to dump the binary image with the USB-serial adapter, the image is correct. Every time! What is the terminal program doing that's not being done in my application? My application is quite simple. Has anyone observed this behavior before? If you have, I'd like to know how you've gotten around this problem. Thanks, LT =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From tjarvi at qbang.org Tue Apr 22 21:11:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 22 Apr 2008 21:11:10 -0600 (MDT) Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org From Loi.TRAN at weatherford.com Wed Apr 23 08:35:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Wed, 23 Apr 2008 09:35:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: Thanks for all the responses. I finally tried something that worked consistently. I updated my Prolific driver and repeated my tests. It worked. If you're using the Prolific type USB-serial adapters, do no use the Prolific version 2.0.2.1 driver on Windows. Update it to the latest 2.0.2.8 version. Again, thanks for all the responses. LT -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Tuesday, April 22, 2008 10:11 PM To: TRAN, Loi X. Cc: rxtx at qbang.org Subject: Re: [Rxtx] Prolific USB - RXTX data mangled On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From Martin.Oberhuber at windriver.com Wed Apr 23 18:54:26 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 02:54:26 +0200 Subject: [Rxtx] RXTX port locking on Linux status? Message-ID: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Dear RXTX community, I'm wondering what the status is with RXTX locking serial ports on Linux? My understanding is that the mechanism used in 2.1-7r2 (lockfiles) is not really state of the art, and has lots of problems (e.g. missing permissions). There was an idea to migrate towards a Kernel syscall based solution for port locking. What's the status here? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/9878db9f/attachment-0027.html From tjarvi at qbang.org Wed Apr 23 20:32:24 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Apr 2008 20:32:24 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > Dear RXTX community, > > I'm wondering what the status is with RXTX locking > serial ports on Linux? > > My understanding is that the mechanism used in > 2.1-7r2 (lockfiles) is not really state of the art, and > has lots of problems (e.g. missing permissions). > > There was an idea to migrate towards a Kernel > syscall based solution for port locking. > > What's the status here? > Hi Martin, I'm in favor of deprecating the current FHS locking mechanism in favor of an IOCTL when available. I think it will be available on all the platforms but do not know for sure. The status is unchanged. I've had very few free cycles for such things. Feel free to take a stab at it if you have some time. I believe the IOCTL is used in the Mac OS X code already. I don't see any real backwards compatability issues and the IOCTL should just work. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Apr 24 06:14:06 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 14:14:06 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Thanks Trent. Problem is only that I'm really not at all Familiar with the C part of RXTX. If there Were anything I could do in Java for this, It would be easier for me.... ... Are there any C experts here on the list Who'd like to look at ioctl port locking For linux? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Donnerstag, 24. April 2008 04:32 > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > I'm wondering what the status is with RXTX locking > > serial ports on Linux? > > > > My understanding is that the mechanism used in > > 2.1-7r2 (lockfiles) is not really state of the art, and > > has lots of problems (e.g. missing permissions). > > > > There was an idea to migrate towards a Kernel > > syscall based solution for port locking. > > > > What's the status here? > > > > Hi Martin, > > I'm in favor of deprecating the current FHS locking mechanism > in favor of > an IOCTL when available. I think it will be available on all the > platforms but do not know for sure. > > The status is unchanged. I've had very few free cycles for > such things. > Feel free to take a stab at it if you have some time. I > believe the IOCTL > is used in the Mac OS X code already. > > I don't see any real backwards compatability issues and the > IOCTL should > just work. > > -- > Trent Jarvi > tjarvi at qbang.org > From sspies at sloc.de Thu Apr 24 07:15:36 2008 From: sspies at sloc.de (Sebastian Spies) Date: Thu, 24 Apr 2008 15:15:36 +0200 (CEST) Subject: [Rxtx] rxtx on gumstix: Interrupted system call In-Reply-To: <47FB7B20.7080504@sloc.de> References: <47FB7B20.7080504@sloc.de> Message-ID: <55445.130.83.139.205.1209042936.squirrel@ssl.sloc.de> Dear list, while porting rxtx to the gumstix, I found out, that select used in readArray in SerialImp.c might not work as expected. Maybe, because of missing TIOCSERGETLSR-support? select is often interrupted, so i wrote the following quick'n'dirty hack to make it work on gumstix: diff -Nur rxtx-2.1-7r2/src/SerialImp.c rxtx-2.1-7r2/src/SerialImp.c --- rxtx-2.1-7r2/src/SerialImp.c 2006-01-29 23:19:04.000000000 +0100 +++ rxtx-2.1-7r2-patched/src/SerialImp.c 2008-04-24 14:30:17.000000000 +0200 @@ -3380,7 +3381,7 @@ JNIEXPORT jint JNICALL RXTXPort(readArray)( JNIEnv *env, jobject jobj, jbyteArray jbarray, jint offset, jint length ) { - int bytes; + int bytes = 0; jbyte *body; /* char msg[80]; */ int fd = get_java_var( env, jobj, "fd", "I" ); @@ -3397,9 +3398,18 @@ "readArray", "Invalid length" ); return -1; } - body = (*env)->GetByteArrayElements( env, jbarray, 0 ); - bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ - (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + while(1 > bytes) + { + body = (*env)->GetByteArrayElements( env, jbarray, 0 ); + bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ + (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + // quick'n'dirty - SSP + report (" trying again... \n"); + errno = 0; + } + if( bytes < 0 ) { report( "RXTXPort:readArray bytes < 0" ); LEAVE( "RXTXPort:readArray" ); > Hey, > > I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use > RXTXPort$SerialInputStream.read(), then I get the following Exception. I > did not yet figure out which system call is interrupted as strace > produces loads of output. > > Any help would be very appreciated. Thanks in advance. > Sebastian > > > [java] java.io.IOException: Interrupted system call in readArray > [java] at gnu.io.RXTXPort.readArray(Native Method) > [java] at > gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) > [java] at > java.io.FilterInputStream.read(FilterInputStream.java:189) > [java] at > java.io.BufferedInputStream.refill(BufferedInputStream.java:371) > [java] at > java.io.BufferedInputStream.read(BufferedInputStream.java:229) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) > [java] at > com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) > > -- > Sebastian Spies > > mail: sspies at sloc.de > > > > From fire_baptized at hotmail.com Thu Apr 24 18:27:48 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Thu, 24 Apr 2008 20:27:48 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hello I am having a problem with the serial device connecting (software wise) to the serial port. However I have a test program and it seems to work just fine in that environment - and it doesnt use GUI. The error I am getting is : PortNotFoundException Now the way I have it setup in the GUI environment is that once the user pushes a JButton the program connects using this class: protected void establishConnection() { try { portId = CommPortIdentifier.getPortIdentifier("COM3"); System.out.println("Establishing connction....."); messages[0] = "\nEstablishing connction.....\n"; } catch ( NoSuchPortException noport) { System.out.println("Port not found: "+ noport); messages[0] = "Port not found: "+ noport+"\n"; } try { serialPort = (SerialPort) portId.open("serial", 50); System.out.println("Port has been found."); messages[1] = "Port has been found.\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[1] = "" +usedport; } try { serialPort = (SerialPort) portId.open("serial", 50); messages[2] = "Connecting to COM3 on port 50....\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; } try { serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); System.out.println("Esablishing the transfer rate settings for COM3."); messages[3] = "Esablishing the transfer rate settings for COM3.\n"; } catch (UnsupportedCommOperationException nosupcom) { System.out.println(nosupcom); System.out.println("The tranfer rate could not be esblished on COM3."); messages[3] = "The tranfer rate could not be esblished on COM3.\n"; } System.out.println(serialPort.getFlowControlMode()); messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; //sendDataOut(buffer[3],buffer[4]); } I need all the data in this method (and all the string values in this method) to be printed out on a JTextArea. I wont do me any good if not all the text is printed on a JTextArea in another class. So I have the text printing the JTextArea correctly, but everytime the JButton is activated - it gives me that error message. I did add a disconnect button that is supposed to call the serialPort.close(). _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/273fd4ec/attachment-0026.html From tjarvi at qbang.org Thu Apr 24 21:54:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Apr 2008 21:54:10 -0600 (MDT) Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > Hello I am having a problem with the serial device connecting (software > wise) to the serial port. However I have a test program and it seems to > work just fine in that environment - and it doesnt use GUI. The error I > am getting is : PortNotFoundException Now the way I have it setup in the > GUI environment is that once the user pushes a JButton the program > connects using this class: > > protected void establishConnection() { > try { > portId = CommPortIdentifier.getPortIdentifier("COM3"); > System.out.println("Establishing connction....."); > messages[0] = "\nEstablishing connction.....\n"; > } > catch ( NoSuchPortException noport) { > System.out.println("Port not found: "+ noport); > messages[0] = "Port not found: "+ noport+"\n"; > } > try { > serialPort = (SerialPort) portId.open("serial", 50); > System.out.println("Port has been found."); > messages[1] = "Port has been found.\n"; > } > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[1] = "" +usedport; > } ================================================================= > try { > serialPort = (SerialPort) portId.open("serial", 50); > messages[2] = "Connecting to COM3 on port 50....\n"; > } ================================================================== > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > } > try { > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > System.out.println("Esablishing the transfer rate settings for COM3."); > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > } > catch (UnsupportedCommOperationException nosupcom) { > System.out.println(nosupcom); > System.out.println("The tranfer rate could not be esblished on COM3."); > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > } > System.out.println(serialPort.getFlowControlMode()); > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > //sendDataOut(buffer[3],buffer[4]); > } > > I need all the data in this method (and all the string values in this > method) to be printed out on a JTextArea. I wont do me any good if not > all the text is printed on a JTextArea in another class. So I have the > text printing the JTextArea correctly, but everytime the JButton is > activated - it gives me that error message. I did add a disconnect > button that is supposed to call the serialPort.close(). > The open code used twice is going to throw an exception. It may be that you catch the exception above this code and print a confusing message? A common mistake is people will accidently run two copies of their program. The first instance of the program will open the port and prevent enumeration (finding the port) in the second instance of the program. As an example, you may be running your text based application which is preventing the GUI from seeing the port. Enumeration is done by trying to open the port. If the port is open, Enumeration fails. -- Trent Jarvi tjarvi at qbang.org From fire_baptized at hotmail.com Thu Apr 24 22:32:05 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 00:32:05 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Wow - thanks dude what a dumb thing for me to not catch..... now here is the current problem - right now I am trying to output data again one is with the test program - and it seems that serialPort.setRTS(true); is throwing an exceptions there - now if I show this code please bare in mind that I am only testing - the code is kinda sloppy in my mind - but if I can figure out why calling this function is throwing an exception then maybe I can figure out why my GUI application is getting the same null pointer exceptions when try to send out the data stream. FYI Trent this email is not directed towards you - anyone can jump in on this public static void main(String args[]) { byte[] b = new byte[64]; int keyinput = 0 ; byte x = 0; byte y = 0; PortTesting1 testports = new PortTesting1(); try { joyskoro = Joystick.createInstance(); } catch (IOException ioexc) { System.out.println("There is an input/output problem: " + ioexc); } while (true) { joyskoro.poll(); b[0] = ((byte) -(10 * joyskoro.getY())); b[1] = ((byte) (10 * joyskoro.getX())); System.out.println("The 3rd byte is: " +b[0]); System.out.println("The 4rd byte is: " +b[1]); serialPort.setRTS(true); // HERE IS WHERE THE PROBLEM IS !!!!!!! ON THIS LINE but if I dont have it active in my program the Bluetooth device (that is System.out.println("Ready to send :-) !"); //connected to the serial port does not send out data!!!!! if (joyskoro.isButtonDown(joyskoro.BUTTON10)) { System.out.println("Connection terminated."); serialPort.close(); break; } if (joyskoro.isButtonDown(joyskoro.BUTTON2)) { boolean flag = true; //reading from key input from the keyboard System.out.println("Please input a command: "); while (flag) { try { keyinput = System.in.read(); } catch (IOException ioexc) {/*there is no need to put * anything here */ } if((char)keyinput=='w') { pushIt((byte)85); } if((char)keyinput=='s') { pushIt((byte)84); } if((char)keyinput=='a') { pushIt((byte)83); } if((char)keyinput=='d') { pushIt((byte)82); } if((char)keyinput=='q') { pushIt((byte)89); } if((char)keyinput=='\t') { //this stop reading input from the keyboard flag = false; } } and help anyways here is the block of code that throwing an exception for the test program: > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/5c8f7d68/attachment-0026.html From fire_baptized at hotmail.com Fri Apr 25 07:59:53 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 09:59:53 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Are there any examples of how to push out data? As in using input and output streams - if I can compare code maybe I can see where this is causing a problem. I have a byte array that I am pushing out data. I keep getting null pointer exceptions every where I turn. > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/22228ab6/attachment-0025.html From ajmas at sympatico.ca Sat Apr 26 07:37:09 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 26 Apr 2008 09:37:09 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hi, On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote: > > Are there any examples of how to push out data? As in using input > and output streams - if I can compare code maybe I can see where > this is causing a problem. I have a byte array that I am pushing > out data. I keep getting null pointer exceptions every where I turn. > There are some examples here that might be of help: http://rxtx.qbang.org/wiki/index.php/Examples Andre From fire_baptized at hotmail.com Sat Apr 26 20:13:54 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Sat, 26 Apr 2008 22:13:54 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: looked at those....yep didnt help - I need to push out data with GUI and not get a null pointer exception everytime I try. > CC: rxtx at qbang.org> From: ajmas at sympatico.ca> To: fire_baptized at hotmail.com> Subject: Re: [Rxtx] Serial Problems with Gui.....> Date: Sat, 26 Apr 2008 09:37:09 -0400> > Hi,> > > On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote:> >> > Are there any examples of how to push out data? As in using input > > and output streams - if I can compare code maybe I can see where > > this is causing a problem. I have a byte array that I am pushing > > out data. I keep getting null pointer exceptions every where I turn.> >> > There are some examples here that might be of help:> > http://rxtx.qbang.org/wiki/index.php/Examples> > Andre _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080426/09f95b41/attachment-0024.html From michael.erskine at ketech.com Mon Apr 28 02:47:22 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 28 Apr 2008 09:47:22 +0100 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D426EF3CBBC5@no-sv-03.ketech.local> Jesrael D. Summerhill wrote: > looked at those....yep didnt help - I need to push out data with GUI and > not get a null pointer exception everytime I try. So it seems pretty obvious that your code needs to check for nulls wherever one may occur and report what's happening. Alternatively, catch the npe and display the stack trace. Then you can fix your code so it doesn't try to work with something that ain't there. Regards, Michael Erskine. From scldad at sdc.com.au Mon Apr 28 03:58:34 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Mon, 28 Apr 2008 19:28:34 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Message-ID: <200804281928.34454.scldad@sdc.com.au> Has anybody done any design work on this? The first thing that springs to mind is that we still need to check for lock files because other apps tend to use that approach even if we go to ioctl. Cheers, Stephen Davies On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > Thanks Trent. > > Problem is only that I'm really not at all > Familiar with the C part of RXTX. If there > Were anything I could do in Java for this, > It would be easier for me.... > > ... Are there any C experts here on the list > Who'd like to look at ioctl port locking > For linux? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > -----Original Message----- > > From: Trent Jarvi [mailto:tjarvi at qbang.org] > > Sent: Donnerstag, 24. April 2008 04:32 > > To: Oberhuber, Martin > > Cc: rxtx at qbang.org > > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > > > I'm wondering what the status is with RXTX locking > > > serial ports on Linux? > > > > > > My understanding is that the mechanism used in > > > 2.1-7r2 (lockfiles) is not really state of the art, and > > > has lots of problems (e.g. missing permissions). > > > > > > There was an idea to migrate towards a Kernel > > > syscall based solution for port locking. > > > > > > What's the status here? > > > > Hi Martin, > > > > I'm in favor of deprecating the current FHS locking mechanism > > in favor of > > an IOCTL when available. I think it will be available on all the > > platforms but do not know for sure. > > > > The status is unchanged. I've had very few free cycles for > > such things. > > Feel free to take a stab at it if you have some time. I > > believe the IOCTL > > is used in the Mac OS X code already. > > > > I don't see any real backwards compatability issues and the > > IOCTL should > > just work. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Mon Apr 28 04:21:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 28 Apr 2008 04:21:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804281928.34454.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: I don't think there would need to be any architectural changes. A couple ifdefs and minor changes in the current code should be enough. Proposal: FHS/UUCP locks: continue to respect them, try to create them but do not error if the IOCTL is supported. (But does the IOCTL being defined mean it will work?) Enumeration: Do not assert the IOCTL while opening. Serial.open: assert the IOCTL after open. Continue to use locks as described above after asserting the IOCTL. If the IOCTL is defined but not working, handle it here. Failure cases include the IOCTL is not supported and the port is already locked. On Mon, 28 Apr 2008, Stephen Davies wrote: > Has anybody done any design work on this? > The first thing that springs to mind is that we still need to check for lock > files because other apps tend to use that approach even if we go to ioctl. > > Cheers, > Stephen Davies > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: >> Thanks Trent. >> >> Problem is only that I'm really not at all >> Familiar with the C part of RXTX. If there >> Were anything I could do in Java for this, >> It would be easier for me.... >> >> ... Are there any C experts here on the list >> Who'd like to look at ioctl port locking >> For linux? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >>> -----Original Message----- >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] >>> Sent: Donnerstag, 24. April 2008 04:32 >>> To: Oberhuber, Martin >>> Cc: rxtx at qbang.org >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? >>> >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: >>>> Dear RXTX community, >>>> >>>> I'm wondering what the status is with RXTX locking >>>> serial ports on Linux? >>>> >>>> My understanding is that the mechanism used in >>>> 2.1-7r2 (lockfiles) is not really state of the art, and >>>> has lots of problems (e.g. missing permissions). >>>> >>>> There was an idea to migrate towards a Kernel >>>> syscall based solution for port locking. >>>> >>>> What's the status here? >>> >>> Hi Martin, >>> >>> I'm in favor of deprecating the current FHS locking mechanism >>> in favor of >>> an IOCTL when available. I think it will be available on all the >>> platforms but do not know for sure. >>> >>> The status is unchanged. I've had very few free cycles for >>> such things. >>> Feel free to take a stab at it if you have some time. I >>> believe the IOCTL >>> is used in the Mac OS X code already. >>> >>> I don't see any real backwards compatability issues and the >>> IOCTL should >>> just work. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Tue Apr 29 12:04:04 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Apr 2008 20:04:04 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Hi all, The biggest problem that I have seen with lockfiles on Linux At least is, that it seems there is no standard with respect To the folder in which they should be created. Also, many Distributions seem to set up file system permissions in such A way that writing to the lockfile folder is not allowed for The normal user -- that's why we stopped using lockfiles In our commercial product. If we are to still respect lockfiles, we first need to Understand where we are expected to look for them. Does Anybody have any insight what variants of lockfile folder Schema exist out there in the wild? Some apps like minicom Seem to even allow users to manually specify a lockfile Folder of their choice. Because of the difficulty finding the right lockfile folder, And because of the inherent risk of thinking that something Might be locked while it actually isn't, I'd suggest that RXTX should have a "soft-off" feature that allows disabling ALL Lockfile checks at runtime without recompiling the native Sharedlibs. Trent - I like your strategy outline, but I think that it Needs to be configurable by the client such that users and/or Customer Support can disable lockfiles / disable ioctl in Case they detect that they are runing on an OS / Kernal that Does not support one or the other. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Montag, 28. April 2008 12:22 > To: Stephen Davies > Cc: rxtx at qbang.org; Oberhuber, Martin; Trent Jarvi > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > I don't think there would need to be any architectural > changes. A couple > ifdefs and minor changes in the current code should be enough. > > Proposal: > > FHS/UUCP locks: > continue to respect them, try to create them but do not error if > the IOCTL is supported. (But does the IOCTL being defined mean > it will work?) > Enumeration: > Do not assert the IOCTL while opening. > Serial.open: > assert the IOCTL after open. Continue to use locks as described > above after asserting the IOCTL. If the IOCTL is defined but > not working, handle it here. Failure cases include the IOCTL > is not supported and the port is already locked. > > On Mon, 28 Apr 2008, Stephen Davies wrote: > > > Has anybody done any design work on this? > > The first thing that springs to mind is that we still need > to check for lock > > files because other apps tend to use that approach even if > we go to ioctl. > > > > Cheers, > > Stephen Davies > > > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > >> Thanks Trent. > >> > >> Problem is only that I'm really not at all > >> Familiar with the C part of RXTX. If there > >> Were anything I could do in Java for this, > >> It would be easier for me.... > >> > >> ... Are there any C experts here on the list > >> Who'd like to look at ioctl port locking > >> For linux? > >> > >> Thanks, > >> -- > >> Martin Oberhuber, Senior Member of Technical Staff, Wind River > >> Target Management Project Lead, DSDP PMC Member > >> http://www.eclipse.org/dsdp/tm > >> > >>> -----Original Message----- > >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] > >>> Sent: Donnerstag, 24. April 2008 04:32 > >>> To: Oberhuber, Martin > >>> Cc: rxtx at qbang.org > >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? > >>> > >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > >>>> Dear RXTX community, > >>>> > >>>> I'm wondering what the status is with RXTX locking > >>>> serial ports on Linux? > >>>> > >>>> My understanding is that the mechanism used in > >>>> 2.1-7r2 (lockfiles) is not really state of the art, and > >>>> has lots of problems (e.g. missing permissions). > >>>> > >>>> There was an idea to migrate towards a Kernel > >>>> syscall based solution for port locking. > >>>> > >>>> What's the status here? > >>> > >>> Hi Martin, > >>> > >>> I'm in favor of deprecating the current FHS locking mechanism > >>> in favor of > >>> an IOCTL when available. I think it will be available on all the > >>> platforms but do not know for sure. > >>> > >>> The status is unchanged. I've had very few free cycles for > >>> such things. > >>> Feel free to take a stab at it if you have some time. I > >>> believe the IOCTL > >>> is used in the Mac OS X code already. > >>> > >>> I don't see any real backwards compatability issues and the > >>> IOCTL should > >>> just work. > >>> > >>> -- > >>> Trent Jarvi > >>> tjarvi at qbang.org > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > From Steffen.DETTMER at ingenico.com Tue Apr 29 13:34:44 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 29 Apr 2008 21:34:44 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Message-ID: <20080429193444.GU2928@elberon.bln.de.ingenico.com> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > The biggest problem that I have seen with lockfiles on Linux > At least is, that it seems there is no standard with respect > To the folder in which they should be created. Also, many > Distributions seem to set up file system permissions in such > A way that writing to the lockfile folder is not allowed for > The normal user -- that's why we stopped using lockfiles > In our commercial product. It seems it depends on the expectations. I consider it as a feature that by default a linux user cannot access serial ports. Maybe root connected a modem (can produce phone bills) or even some serial card reader, maybe with the web servers key pair. I would expect that by default a user cannot open the serial port because of insufficient permissions on the device file. I would expect this on other unices as well (but I don't know it). For windows I think it should be similar but not impacting so much in practice, because often windows users work with big permissions on a somewhat high priviledge level or even Administrator. > If we are to still respect lockfiles, we first need to > Understand where we are expected to look for them. Does > Anybody have any insight what variants of lockfile folder > Schema exist out there in the wild? Some apps like minicom > Seem to even allow users to manually specify a lockfile > Folder of their choice. At least my (ancient) minicom does not allow the user to change this option, it is displayed but read-only, but root is allowed to change it. > Because of the difficulty finding the right lockfile folder, > And because of the inherent risk of thinking that something > Might be locked while it actually isn't, I'd suggest that > RXTX should have a "soft-off" feature that allows disabling > ALL Lockfile checks at runtime without recompiling the native > Sharedlibs. sounds very reasonable, yes... and as admin I would not wish that users could skip such locking because they do things wrong by default ;) (in the end I guess that is related to the dilemma, that hotplug/user-owned-periphery and multi-user systems simply conflict) > Trent - I like your strategy outline, but I think that it > Needs to be configurable by the client such that users and/or > Customer Support can disable lockfiles / disable ioctl in > Case they detect that they are runing on an OS / Kernal that > Does not support one or the other. Yes, this would be good I guess... Applications could offer configuration options to control that, maybe similarily as minicom. BTW, man minicom tells: *B - Lock file location On most systems This should be /usr/spool/uucp. Linux systems use /var/lock. If this directory does not exist, minicom will not attempt to use lockfiles. The statement `Linux systems use /var/lock' is interesting, does anyone know the source of this convention? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Tue Apr 29 16:11:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Apr 2008 16:11:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? These details are outlined in the Filesystem Hierarchy Standard (FHS). http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLOCKLOCKFILES -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Tue Apr 29 18:58:09 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Wed, 30 Apr 2008 10:28:09 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: <200804301028.09307.scldad@sdc.com.au> I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is the same. Any ideas as to how to handle this? Stephen On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: > * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > > The biggest problem that I have seen with lockfiles on Linux > > At least is, that it seems there is no standard with respect > > To the folder in which they should be created. Also, many > > Distributions seem to set up file system permissions in such > > A way that writing to the lockfile folder is not allowed for > > The normal user -- that's why we stopped using lockfiles > > In our commercial product. > > It seems it depends on the expectations. I consider it as a > feature that by default a linux user cannot access serial ports. > Maybe root connected a modem (can produce phone bills) or even > some serial card reader, maybe with the web servers key pair. > > I would expect that by default a user cannot open the serial port > because of insufficient permissions on the device file. I would > expect this on other unices as well (but I don't know it). > > For windows I think it should be similar but not impacting so > much in practice, because often windows users work with big > permissions on a somewhat high priviledge level or even > Administrator. > > > If we are to still respect lockfiles, we first need to > > Understand where we are expected to look for them. Does > > Anybody have any insight what variants of lockfile folder > > Schema exist out there in the wild? Some apps like minicom > > Seem to even allow users to manually specify a lockfile > > Folder of their choice. > > At least my (ancient) minicom does not allow the user to change > this option, it is displayed but read-only, but root is allowed > to change it. > > > Because of the difficulty finding the right lockfile folder, > > And because of the inherent risk of thinking that something > > Might be locked while it actually isn't, I'd suggest that > > RXTX should have a "soft-off" feature that allows disabling > > ALL Lockfile checks at runtime without recompiling the native > > Sharedlibs. > > sounds very reasonable, yes... > and as admin I would not wish that users could skip such > locking because they do things wrong by default ;) > > (in the end I guess that is related to the dilemma, that > hotplug/user-owned-periphery and multi-user systems simply > conflict) > > > Trent - I like your strategy outline, but I think that it > > Needs to be configurable by the client such that users and/or > > Customer Support can disable lockfiles / disable ioctl in > > Case they detect that they are runing on an OS / Kernal that > > Does not support one or the other. > > Yes, this would be good I guess... Applications could offer > configuration options to control that, maybe similarily as > minicom. > > BTW, man minicom tells: > > *B - Lock file location > On most systems This should be /usr/spool/uucp. > Linux systems use /var/lock. If this directory > does not exist, minicom will not attempt to use > lockfiles. > > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure > and expedient electronic transaction acceptance. Ingenico products leverage > proven technology, established standards and unparalleled ergonomics to > provide optimal reliability, versatility and usability. This comprehensive > range of products is complemented by a global array of services and > partnerships, enabling businesses in a number of vertical sectors to accept > transactions anywhere their business takes them. www.ingenico.com This > message may contain confidential and/or privileged information. If you are > not the addressee or authorized to receive this for the addressee, you must > not use, copy, disclose or take any action based on this message or any > information herein. If you have received this message in error, please > advise the sender immediately by reply e-mail and delete this message. > Thank you for your cooperation. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Wed Apr 30 19:30:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 30 Apr 2008 19:30:51 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804301028.09307.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> <200804301028.09307.scldad@sdc.com.au> Message-ID: Hi Stephen, I suspect ioctl/TIOCEXCL open/O_EXCL would do the job. Mac uses TIOCEXCL and it is POSIX. We use O_EXCL for lockfiles on Linux already. On Wed, 30 Apr 2008, Stephen Davies wrote: > I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is > the same. > > Any ideas as to how to handle this? > > Stephen > > > On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: >> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: >>> The biggest problem that I have seen with lockfiles on Linux >>> At least is, that it seems there is no standard with respect >>> To the folder in which they should be created. Also, many >>> Distributions seem to set up file system permissions in such >>> A way that writing to the lockfile folder is not allowed for >>> The normal user -- that's why we stopped using lockfiles >>> In our commercial product. >> >> It seems it depends on the expectations. I consider it as a >> feature that by default a linux user cannot access serial ports. >> Maybe root connected a modem (can produce phone bills) or even >> some serial card reader, maybe with the web servers key pair. >> >> I would expect that by default a user cannot open the serial port >> because of insufficient permissions on the device file. I would >> expect this on other unices as well (but I don't know it). >> >> For windows I think it should be similar but not impacting so >> much in practice, because often windows users work with big >> permissions on a somewhat high priviledge level or even >> Administrator. >> >>> If we are to still respect lockfiles, we first need to >>> Understand where we are expected to look for them. Does >>> Anybody have any insight what variants of lockfile folder >>> Schema exist out there in the wild? Some apps like minicom >>> Seem to even allow users to manually specify a lockfile >>> Folder of their choice. >> >> At least my (ancient) minicom does not allow the user to change >> this option, it is displayed but read-only, but root is allowed >> to change it. >> >>> Because of the difficulty finding the right lockfile folder, >>> And because of the inherent risk of thinking that something >>> Might be locked while it actually isn't, I'd suggest that >>> RXTX should have a "soft-off" feature that allows disabling >>> ALL Lockfile checks at runtime without recompiling the native >>> Sharedlibs. >> >> sounds very reasonable, yes... >> and as admin I would not wish that users could skip such >> locking because they do things wrong by default ;) >> >> (in the end I guess that is related to the dilemma, that >> hotplug/user-owned-periphery and multi-user systems simply >> conflict) >> >>> Trent - I like your strategy outline, but I think that it >>> Needs to be configurable by the client such that users and/or >>> Customer Support can disable lockfiles / disable ioctl in >>> Case they detect that they are runing on an OS / Kernal that >>> Does not support one or the other. >> >> Yes, this would be good I guess... Applications could offer >> configuration options to control that, maybe similarily as >> minicom. >> >> BTW, man minicom tells: >> >> *B - Lock file location >> On most systems This should be /usr/spool/uucp. >> Linux systems use /var/lock. If this directory >> does not exist, minicom will not attempt to use >> lockfiles. >> >> The statement `Linux systems use /var/lock' is interesting, does >> anyone know the source of this convention? >> >> oki, >> >> Steffen >> >> About Ingenico Throughout the world businesses rely on Ingenico for secure >> and expedient electronic transaction acceptance. Ingenico products leverage >> proven technology, established standards and unparalleled ergonomics to >> provide optimal reliability, versatility and usability. This comprehensive >> range of products is complemented by a global array of services and >> partnerships, enabling businesses in a number of vertical sectors to accept >> transactions anywhere their business takes them. www.ingenico.com This >> message may contain confidential and/or privileged information. If you are >> not the addressee or authorized to receive this for the addressee, you must >> not use, copy, disclose or take any action based on this message or any >> information herein. If you have received this message in error, please >> advise the sender immediately by reply e-mail and delete this message. >> Thank you for your cooperation. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0050.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0048.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0035.html From pboulton at pulsetracer.com Fri Apr 18 14:30:13 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Fri, 18 Apr 2008 13:30:13 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site Message-ID: <480904D5.1060307@pulsetracer.com> Hello, gentle serial porters. I have downloaded the zipped up binaries for use on Windows without Sun's CommAPI, but don't seem able to extract anything from the download. Go to main page, http://www.rxtx.org/ Click on Downloads I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) And I save it to disk. If I try and extract the files with WinZip, Winzip thinks the archive is corrupt. If I try using Windows Explorer, I am able to extract it into a single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than the original .zip. Any help would be much appreciated. Sincerely, Philip Boulton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080418/97d89793/attachment-0033.html From tjarvi at qbang.org Fri Apr 18 19:07:00 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 18 Apr 2008 19:07:00 -0600 (MDT) Subject: [Rxtx] Difficulty opening zip file at rxtx site In-Reply-To: <480904D5.1060307@pulsetracer.com> References: <480904D5.1060307@pulsetracer.com> Message-ID: On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org From pboulton at pulsetracer.com Sat Apr 19 12:46:26 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Sat, 19 Apr 2008 11:46:26 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site References: <480904D5.1060307@pulsetracer.com> Message-ID: <53DB7576450695419E09299104043761A78533@ZTGSERVER.ztg.local> I have been able to get my hands on the binaries, by going to the ftp directory /pub/rxtx at ftp.qbang.org,, and ftping the file rxtx-2.1-7-bins-r2.zip . This opens happily with Winzip, and extracts as the set of files that you describe below. I only experience the ill-formed archive problem by clicking the link on the rxtx.org Downloads page (http://rxtx.qbang.org/pub/rxtx/ rxtx-2.1-7-bins-r2.zip ). Not sure what to make of that. Philip Boulton ________________________________ From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Fri 4/18/2008 6:07 PM To: Philip Boulton Cc: rxtx at qbang.org Subject: Re: [Rxtx] Difficulty opening zip file at rxtx site On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080419/147923bb/attachment-0032.html From jlar310 at gmail.com Sat Apr 19 19:11:55 2008 From: jlar310 at gmail.com (Jeff Larsen) Date: Sat, 19 Apr 2008 20:11:55 -0500 Subject: [Rxtx] Moxa serial over Ethernet driver Message-ID: Hi all, I've been using javax.comm for years to communicate with a legacy radio data system. We want to migrate the java side of the system to a VMware Server virtual machine. We've had great success using Moxa DE-303 and 5610 serial over Ethernet appliances and virtual machines for running hylafax. The OS (Linux in this case) uses a kernel driver to communicate with the Moxa via a virtual serial port such as /dev/ttyr00. I want to do the same thing with javax.comm or gnu.io to connect to a virtual serial port. However I'm hitting road blocks everywhere. javax.comm for Linux sees the virtual port, but there are transmission errors. Tried Solaris too, but the Solaris Moxa drivers don't play nice with javax.comm because the driver uses /dev/pts/n instead of /dev/term/x. Next I tried RXTX on Linux, but I'm getting NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX on Solaris. Has anyone used RXTX with serial over Ethernet devices? Any hints on how to make it work? I know that I'm not completely off track because javax.comm does work with Moxa on a Windows platform, but that's just not an option for production deployment. -- Jeff From tjarvi at qbang.org Sat Apr 19 21:08:41 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 19 Apr 2008 21:08:41 -0600 (MDT) Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: yOn Sat, 19 Apr 2008, Jeff Larsen wrote: > Hi all, > > I've been using javax.comm for years to communicate with a legacy > radio data system. We want to migrate the java side of the system to a > VMware Server virtual machine. We've had great success using Moxa > DE-303 and 5610 serial over Ethernet appliances and virtual machines > for running hylafax. The OS (Linux in this case) uses a kernel driver > to communicate with the Moxa via a virtual serial port such as > /dev/ttyr00. > > I want to do the same thing with javax.comm or gnu.io to connect to a > virtual serial port. However I'm hitting road blocks everywhere. > javax.comm for Linux sees the virtual port, but there are transmission > errors. Tried Solaris too, but the Solaris Moxa drivers don't play > nice with javax.comm because the driver uses /dev/pts/n instead of > /dev/term/x. Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris. > > Has anyone used RXTX with serial over Ethernet devices? Any hints on > how to make it work? > > I know that I'm not completely off track because javax.comm does work > with Moxa on a Windows platform, but that's just not an option for > production deployment. > > Moxa should work under linux. There may be minor issues depending upon how complete the kernel driver is but I think it will work. One of the minor issues is /dev/ttyr00 is not enumerated. There are several work arounds documented with the source code and on the wiki. The easiest solution for testing purposes is to make a symbolic link from /dev/ttyr00 to a port that is enumerated such as /dev/ttyS129. You can later alter the rxtx source or use properties to change the enumerated ports. -- Trent Jarvi tjarvi at qbang.org From d.tonhofer at m-plify.com Sun Apr 20 03:33:30 2008 From: d.tonhofer at m-plify.com (David Tonhofer (M-PLIFY S.A.)) Date: Sun, 20 Apr 2008 11:33:30 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: <480B0DEA.5010908@m-plify.com> Jeff Larsen wrote: > Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris It might be that the Java side of RXTX does not recognize that portname. Trying modifying src/RXTXCommDriver.java as described in this case: http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card From ajmas at sympatico.ca Sun Apr 20 16:37:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Apr 2008 18:37:59 -0400 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <480B0DEA.5010908@m-plify.com> References: <480B0DEA.5010908@m-plify.com> Message-ID: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > Jeff Larsen wrote: >> Next I tried RXTX on Linux, but I'm getting >> NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX >> on Solaris > It might be that the Java side of RXTX does not recognize that > portname. > Trying modifying src/RXTXCommDriver.java as described in this case: > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card I wonder whether it would be worth allowing custom port prefixes as a system parameter? For example: gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" Andre From Martin.Oberhuber at windriver.com Tue Apr 22 12:34:36 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 22 Apr 2008 20:34:36 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> References: <480B0DEA.5010908@m-plify.com> <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE6485848056CD6CE@ism-mail03.corp.ad.wrs.com> Sounds like a great idea... I'm wondering how the "variable part" after the Prefixes could be specified though? What about allowing Regular Expression character Classes in the existing System Property for specifying ports: System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyS[0-9],ttyS[ABC],ttyUSB[0-9a-z]"); The set of allowed patterns would of course need to Be restricted compared to REGEX, because it must be A syntax that supports iterating over it. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Montag, 21. April 2008 00:38 > To: rxtx at qbang.org and Users > Subject: Re: [Rxtx] Moxa serial over Ethernet driver > > > On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > > Jeff Larsen wrote: > >> Next I tried RXTX on Linux, but I'm getting > >> NoSuchPortException connecting to /dev/ttyr00. I have yet > to try RXTX > >> on Solaris > > It might be that the Java side of RXTX does not recognize that > > portname. > > Trying modifying src/RXTXCommDriver.java as described in this case: > > > > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_ > SST-4P.2FLP_multiport_card > > I wonder whether it would be worth allowing custom port > prefixes as a > system parameter? For > example: > > gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Loi.TRAN at weatherford.com Tue Apr 22 13:10:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Tue, 22 Apr 2008 14:10:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled Message-ID: Hi, I'm currently using the Java RXTX API to interface to a serial port. The serial port is connected to a bridge board that communicates with our communications system running at 1.875 Mbps which is linked to an embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no flow control). I send a command to the embedded board through the serial-bridge board which then is relayed to the embedded board. The command sent asks the embedded board to dump a binary image. Here's where I'm hitting some problems. I've successfully done this is an integrated serial port from the laptop. The binary file that comes back is consistent on every attempt. When I use the application I've written to do the same thing with a USB-to-serial adapter, the image I get back is not the same as the image I receive through the USB-to-serial adapter is not consistent at all. A final thing is that when I use a terminal program to dump the binary image with the USB-serial adapter, the image is correct. Every time! What is the terminal program doing that's not being done in my application? My application is quite simple. Has anyone observed this behavior before? If you have, I'd like to know how you've gotten around this problem. Thanks, LT =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From tjarvi at qbang.org Tue Apr 22 21:11:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 22 Apr 2008 21:11:10 -0600 (MDT) Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org From Loi.TRAN at weatherford.com Wed Apr 23 08:35:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Wed, 23 Apr 2008 09:35:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: Thanks for all the responses. I finally tried something that worked consistently. I updated my Prolific driver and repeated my tests. It worked. If you're using the Prolific type USB-serial adapters, do no use the Prolific version 2.0.2.1 driver on Windows. Update it to the latest 2.0.2.8 version. Again, thanks for all the responses. LT -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Tuesday, April 22, 2008 10:11 PM To: TRAN, Loi X. Cc: rxtx at qbang.org Subject: Re: [Rxtx] Prolific USB - RXTX data mangled On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From Martin.Oberhuber at windriver.com Wed Apr 23 18:54:26 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 02:54:26 +0200 Subject: [Rxtx] RXTX port locking on Linux status? Message-ID: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Dear RXTX community, I'm wondering what the status is with RXTX locking serial ports on Linux? My understanding is that the mechanism used in 2.1-7r2 (lockfiles) is not really state of the art, and has lots of problems (e.g. missing permissions). There was an idea to migrate towards a Kernel syscall based solution for port locking. What's the status here? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/9878db9f/attachment-0028.html From tjarvi at qbang.org Wed Apr 23 20:32:24 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Apr 2008 20:32:24 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > Dear RXTX community, > > I'm wondering what the status is with RXTX locking > serial ports on Linux? > > My understanding is that the mechanism used in > 2.1-7r2 (lockfiles) is not really state of the art, and > has lots of problems (e.g. missing permissions). > > There was an idea to migrate towards a Kernel > syscall based solution for port locking. > > What's the status here? > Hi Martin, I'm in favor of deprecating the current FHS locking mechanism in favor of an IOCTL when available. I think it will be available on all the platforms but do not know for sure. The status is unchanged. I've had very few free cycles for such things. Feel free to take a stab at it if you have some time. I believe the IOCTL is used in the Mac OS X code already. I don't see any real backwards compatability issues and the IOCTL should just work. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Apr 24 06:14:06 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 14:14:06 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Thanks Trent. Problem is only that I'm really not at all Familiar with the C part of RXTX. If there Were anything I could do in Java for this, It would be easier for me.... ... Are there any C experts here on the list Who'd like to look at ioctl port locking For linux? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Donnerstag, 24. April 2008 04:32 > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > I'm wondering what the status is with RXTX locking > > serial ports on Linux? > > > > My understanding is that the mechanism used in > > 2.1-7r2 (lockfiles) is not really state of the art, and > > has lots of problems (e.g. missing permissions). > > > > There was an idea to migrate towards a Kernel > > syscall based solution for port locking. > > > > What's the status here? > > > > Hi Martin, > > I'm in favor of deprecating the current FHS locking mechanism > in favor of > an IOCTL when available. I think it will be available on all the > platforms but do not know for sure. > > The status is unchanged. I've had very few free cycles for > such things. > Feel free to take a stab at it if you have some time. I > believe the IOCTL > is used in the Mac OS X code already. > > I don't see any real backwards compatability issues and the > IOCTL should > just work. > > -- > Trent Jarvi > tjarvi at qbang.org > From sspies at sloc.de Thu Apr 24 07:15:36 2008 From: sspies at sloc.de (Sebastian Spies) Date: Thu, 24 Apr 2008 15:15:36 +0200 (CEST) Subject: [Rxtx] rxtx on gumstix: Interrupted system call In-Reply-To: <47FB7B20.7080504@sloc.de> References: <47FB7B20.7080504@sloc.de> Message-ID: <55445.130.83.139.205.1209042936.squirrel@ssl.sloc.de> Dear list, while porting rxtx to the gumstix, I found out, that select used in readArray in SerialImp.c might not work as expected. Maybe, because of missing TIOCSERGETLSR-support? select is often interrupted, so i wrote the following quick'n'dirty hack to make it work on gumstix: diff -Nur rxtx-2.1-7r2/src/SerialImp.c rxtx-2.1-7r2/src/SerialImp.c --- rxtx-2.1-7r2/src/SerialImp.c 2006-01-29 23:19:04.000000000 +0100 +++ rxtx-2.1-7r2-patched/src/SerialImp.c 2008-04-24 14:30:17.000000000 +0200 @@ -3380,7 +3381,7 @@ JNIEXPORT jint JNICALL RXTXPort(readArray)( JNIEnv *env, jobject jobj, jbyteArray jbarray, jint offset, jint length ) { - int bytes; + int bytes = 0; jbyte *body; /* char msg[80]; */ int fd = get_java_var( env, jobj, "fd", "I" ); @@ -3397,9 +3398,18 @@ "readArray", "Invalid length" ); return -1; } - body = (*env)->GetByteArrayElements( env, jbarray, 0 ); - bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ - (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + while(1 > bytes) + { + body = (*env)->GetByteArrayElements( env, jbarray, 0 ); + bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ + (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + // quick'n'dirty - SSP + report (" trying again... \n"); + errno = 0; + } + if( bytes < 0 ) { report( "RXTXPort:readArray bytes < 0" ); LEAVE( "RXTXPort:readArray" ); > Hey, > > I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use > RXTXPort$SerialInputStream.read(), then I get the following Exception. I > did not yet figure out which system call is interrupted as strace > produces loads of output. > > Any help would be very appreciated. Thanks in advance. > Sebastian > > > [java] java.io.IOException: Interrupted system call in readArray > [java] at gnu.io.RXTXPort.readArray(Native Method) > [java] at > gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) > [java] at > java.io.FilterInputStream.read(FilterInputStream.java:189) > [java] at > java.io.BufferedInputStream.refill(BufferedInputStream.java:371) > [java] at > java.io.BufferedInputStream.read(BufferedInputStream.java:229) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) > [java] at > com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) > > -- > Sebastian Spies > > mail: sspies at sloc.de > > > > From fire_baptized at hotmail.com Thu Apr 24 18:27:48 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Thu, 24 Apr 2008 20:27:48 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hello I am having a problem with the serial device connecting (software wise) to the serial port. However I have a test program and it seems to work just fine in that environment - and it doesnt use GUI. The error I am getting is : PortNotFoundException Now the way I have it setup in the GUI environment is that once the user pushes a JButton the program connects using this class: protected void establishConnection() { try { portId = CommPortIdentifier.getPortIdentifier("COM3"); System.out.println("Establishing connction....."); messages[0] = "\nEstablishing connction.....\n"; } catch ( NoSuchPortException noport) { System.out.println("Port not found: "+ noport); messages[0] = "Port not found: "+ noport+"\n"; } try { serialPort = (SerialPort) portId.open("serial", 50); System.out.println("Port has been found."); messages[1] = "Port has been found.\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[1] = "" +usedport; } try { serialPort = (SerialPort) portId.open("serial", 50); messages[2] = "Connecting to COM3 on port 50....\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; } try { serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); System.out.println("Esablishing the transfer rate settings for COM3."); messages[3] = "Esablishing the transfer rate settings for COM3.\n"; } catch (UnsupportedCommOperationException nosupcom) { System.out.println(nosupcom); System.out.println("The tranfer rate could not be esblished on COM3."); messages[3] = "The tranfer rate could not be esblished on COM3.\n"; } System.out.println(serialPort.getFlowControlMode()); messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; //sendDataOut(buffer[3],buffer[4]); } I need all the data in this method (and all the string values in this method) to be printed out on a JTextArea. I wont do me any good if not all the text is printed on a JTextArea in another class. So I have the text printing the JTextArea correctly, but everytime the JButton is activated - it gives me that error message. I did add a disconnect button that is supposed to call the serialPort.close(). _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/273fd4ec/attachment-0027.html From tjarvi at qbang.org Thu Apr 24 21:54:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Apr 2008 21:54:10 -0600 (MDT) Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > Hello I am having a problem with the serial device connecting (software > wise) to the serial port. However I have a test program and it seems to > work just fine in that environment - and it doesnt use GUI. The error I > am getting is : PortNotFoundException Now the way I have it setup in the > GUI environment is that once the user pushes a JButton the program > connects using this class: > > protected void establishConnection() { > try { > portId = CommPortIdentifier.getPortIdentifier("COM3"); > System.out.println("Establishing connction....."); > messages[0] = "\nEstablishing connction.....\n"; > } > catch ( NoSuchPortException noport) { > System.out.println("Port not found: "+ noport); > messages[0] = "Port not found: "+ noport+"\n"; > } > try { > serialPort = (SerialPort) portId.open("serial", 50); > System.out.println("Port has been found."); > messages[1] = "Port has been found.\n"; > } > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[1] = "" +usedport; > } ================================================================= > try { > serialPort = (SerialPort) portId.open("serial", 50); > messages[2] = "Connecting to COM3 on port 50....\n"; > } ================================================================== > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > } > try { > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > System.out.println("Esablishing the transfer rate settings for COM3."); > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > } > catch (UnsupportedCommOperationException nosupcom) { > System.out.println(nosupcom); > System.out.println("The tranfer rate could not be esblished on COM3."); > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > } > System.out.println(serialPort.getFlowControlMode()); > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > //sendDataOut(buffer[3],buffer[4]); > } > > I need all the data in this method (and all the string values in this > method) to be printed out on a JTextArea. I wont do me any good if not > all the text is printed on a JTextArea in another class. So I have the > text printing the JTextArea correctly, but everytime the JButton is > activated - it gives me that error message. I did add a disconnect > button that is supposed to call the serialPort.close(). > The open code used twice is going to throw an exception. It may be that you catch the exception above this code and print a confusing message? A common mistake is people will accidently run two copies of their program. The first instance of the program will open the port and prevent enumeration (finding the port) in the second instance of the program. As an example, you may be running your text based application which is preventing the GUI from seeing the port. Enumeration is done by trying to open the port. If the port is open, Enumeration fails. -- Trent Jarvi tjarvi at qbang.org From fire_baptized at hotmail.com Thu Apr 24 22:32:05 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 00:32:05 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Wow - thanks dude what a dumb thing for me to not catch..... now here is the current problem - right now I am trying to output data again one is with the test program - and it seems that serialPort.setRTS(true); is throwing an exceptions there - now if I show this code please bare in mind that I am only testing - the code is kinda sloppy in my mind - but if I can figure out why calling this function is throwing an exception then maybe I can figure out why my GUI application is getting the same null pointer exceptions when try to send out the data stream. FYI Trent this email is not directed towards you - anyone can jump in on this public static void main(String args[]) { byte[] b = new byte[64]; int keyinput = 0 ; byte x = 0; byte y = 0; PortTesting1 testports = new PortTesting1(); try { joyskoro = Joystick.createInstance(); } catch (IOException ioexc) { System.out.println("There is an input/output problem: " + ioexc); } while (true) { joyskoro.poll(); b[0] = ((byte) -(10 * joyskoro.getY())); b[1] = ((byte) (10 * joyskoro.getX())); System.out.println("The 3rd byte is: " +b[0]); System.out.println("The 4rd byte is: " +b[1]); serialPort.setRTS(true); // HERE IS WHERE THE PROBLEM IS !!!!!!! ON THIS LINE but if I dont have it active in my program the Bluetooth device (that is System.out.println("Ready to send :-) !"); //connected to the serial port does not send out data!!!!! if (joyskoro.isButtonDown(joyskoro.BUTTON10)) { System.out.println("Connection terminated."); serialPort.close(); break; } if (joyskoro.isButtonDown(joyskoro.BUTTON2)) { boolean flag = true; //reading from key input from the keyboard System.out.println("Please input a command: "); while (flag) { try { keyinput = System.in.read(); } catch (IOException ioexc) {/*there is no need to put * anything here */ } if((char)keyinput=='w') { pushIt((byte)85); } if((char)keyinput=='s') { pushIt((byte)84); } if((char)keyinput=='a') { pushIt((byte)83); } if((char)keyinput=='d') { pushIt((byte)82); } if((char)keyinput=='q') { pushIt((byte)89); } if((char)keyinput=='\t') { //this stop reading input from the keyboard flag = false; } } and help anyways here is the block of code that throwing an exception for the test program: > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/5c8f7d68/attachment-0027.html From fire_baptized at hotmail.com Fri Apr 25 07:59:53 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 09:59:53 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Are there any examples of how to push out data? As in using input and output streams - if I can compare code maybe I can see where this is causing a problem. I have a byte array that I am pushing out data. I keep getting null pointer exceptions every where I turn. > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/22228ab6/attachment-0026.html From ajmas at sympatico.ca Sat Apr 26 07:37:09 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 26 Apr 2008 09:37:09 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hi, On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote: > > Are there any examples of how to push out data? As in using input > and output streams - if I can compare code maybe I can see where > this is causing a problem. I have a byte array that I am pushing > out data. I keep getting null pointer exceptions every where I turn. > There are some examples here that might be of help: http://rxtx.qbang.org/wiki/index.php/Examples Andre From fire_baptized at hotmail.com Sat Apr 26 20:13:54 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Sat, 26 Apr 2008 22:13:54 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: looked at those....yep didnt help - I need to push out data with GUI and not get a null pointer exception everytime I try. > CC: rxtx at qbang.org> From: ajmas at sympatico.ca> To: fire_baptized at hotmail.com> Subject: Re: [Rxtx] Serial Problems with Gui.....> Date: Sat, 26 Apr 2008 09:37:09 -0400> > Hi,> > > On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote:> >> > Are there any examples of how to push out data? As in using input > > and output streams - if I can compare code maybe I can see where > > this is causing a problem. I have a byte array that I am pushing > > out data. I keep getting null pointer exceptions every where I turn.> >> > There are some examples here that might be of help:> > http://rxtx.qbang.org/wiki/index.php/Examples> > Andre _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080426/09f95b41/attachment-0025.html From michael.erskine at ketech.com Mon Apr 28 02:47:22 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 28 Apr 2008 09:47:22 +0100 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D426EF3CBBC5@no-sv-03.ketech.local> Jesrael D. Summerhill wrote: > looked at those....yep didnt help - I need to push out data with GUI and > not get a null pointer exception everytime I try. So it seems pretty obvious that your code needs to check for nulls wherever one may occur and report what's happening. Alternatively, catch the npe and display the stack trace. Then you can fix your code so it doesn't try to work with something that ain't there. Regards, Michael Erskine. From scldad at sdc.com.au Mon Apr 28 03:58:34 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Mon, 28 Apr 2008 19:28:34 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Message-ID: <200804281928.34454.scldad@sdc.com.au> Has anybody done any design work on this? The first thing that springs to mind is that we still need to check for lock files because other apps tend to use that approach even if we go to ioctl. Cheers, Stephen Davies On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > Thanks Trent. > > Problem is only that I'm really not at all > Familiar with the C part of RXTX. If there > Were anything I could do in Java for this, > It would be easier for me.... > > ... Are there any C experts here on the list > Who'd like to look at ioctl port locking > For linux? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > -----Original Message----- > > From: Trent Jarvi [mailto:tjarvi at qbang.org] > > Sent: Donnerstag, 24. April 2008 04:32 > > To: Oberhuber, Martin > > Cc: rxtx at qbang.org > > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > > > I'm wondering what the status is with RXTX locking > > > serial ports on Linux? > > > > > > My understanding is that the mechanism used in > > > 2.1-7r2 (lockfiles) is not really state of the art, and > > > has lots of problems (e.g. missing permissions). > > > > > > There was an idea to migrate towards a Kernel > > > syscall based solution for port locking. > > > > > > What's the status here? > > > > Hi Martin, > > > > I'm in favor of deprecating the current FHS locking mechanism > > in favor of > > an IOCTL when available. I think it will be available on all the > > platforms but do not know for sure. > > > > The status is unchanged. I've had very few free cycles for > > such things. > > Feel free to take a stab at it if you have some time. I > > believe the IOCTL > > is used in the Mac OS X code already. > > > > I don't see any real backwards compatability issues and the > > IOCTL should > > just work. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Mon Apr 28 04:21:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 28 Apr 2008 04:21:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804281928.34454.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: I don't think there would need to be any architectural changes. A couple ifdefs and minor changes in the current code should be enough. Proposal: FHS/UUCP locks: continue to respect them, try to create them but do not error if the IOCTL is supported. (But does the IOCTL being defined mean it will work?) Enumeration: Do not assert the IOCTL while opening. Serial.open: assert the IOCTL after open. Continue to use locks as described above after asserting the IOCTL. If the IOCTL is defined but not working, handle it here. Failure cases include the IOCTL is not supported and the port is already locked. On Mon, 28 Apr 2008, Stephen Davies wrote: > Has anybody done any design work on this? > The first thing that springs to mind is that we still need to check for lock > files because other apps tend to use that approach even if we go to ioctl. > > Cheers, > Stephen Davies > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: >> Thanks Trent. >> >> Problem is only that I'm really not at all >> Familiar with the C part of RXTX. If there >> Were anything I could do in Java for this, >> It would be easier for me.... >> >> ... Are there any C experts here on the list >> Who'd like to look at ioctl port locking >> For linux? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >>> -----Original Message----- >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] >>> Sent: Donnerstag, 24. April 2008 04:32 >>> To: Oberhuber, Martin >>> Cc: rxtx at qbang.org >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? >>> >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: >>>> Dear RXTX community, >>>> >>>> I'm wondering what the status is with RXTX locking >>>> serial ports on Linux? >>>> >>>> My understanding is that the mechanism used in >>>> 2.1-7r2 (lockfiles) is not really state of the art, and >>>> has lots of problems (e.g. missing permissions). >>>> >>>> There was an idea to migrate towards a Kernel >>>> syscall based solution for port locking. >>>> >>>> What's the status here? >>> >>> Hi Martin, >>> >>> I'm in favor of deprecating the current FHS locking mechanism >>> in favor of >>> an IOCTL when available. I think it will be available on all the >>> platforms but do not know for sure. >>> >>> The status is unchanged. I've had very few free cycles for >>> such things. >>> Feel free to take a stab at it if you have some time. I >>> believe the IOCTL >>> is used in the Mac OS X code already. >>> >>> I don't see any real backwards compatability issues and the >>> IOCTL should >>> just work. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Tue Apr 29 12:04:04 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Apr 2008 20:04:04 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Hi all, The biggest problem that I have seen with lockfiles on Linux At least is, that it seems there is no standard with respect To the folder in which they should be created. Also, many Distributions seem to set up file system permissions in such A way that writing to the lockfile folder is not allowed for The normal user -- that's why we stopped using lockfiles In our commercial product. If we are to still respect lockfiles, we first need to Understand where we are expected to look for them. Does Anybody have any insight what variants of lockfile folder Schema exist out there in the wild? Some apps like minicom Seem to even allow users to manually specify a lockfile Folder of their choice. Because of the difficulty finding the right lockfile folder, And because of the inherent risk of thinking that something Might be locked while it actually isn't, I'd suggest that RXTX should have a "soft-off" feature that allows disabling ALL Lockfile checks at runtime without recompiling the native Sharedlibs. Trent - I like your strategy outline, but I think that it Needs to be configurable by the client such that users and/or Customer Support can disable lockfiles / disable ioctl in Case they detect that they are runing on an OS / Kernal that Does not support one or the other. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Montag, 28. April 2008 12:22 > To: Stephen Davies > Cc: rxtx at qbang.org; Oberhuber, Martin; Trent Jarvi > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > I don't think there would need to be any architectural > changes. A couple > ifdefs and minor changes in the current code should be enough. > > Proposal: > > FHS/UUCP locks: > continue to respect them, try to create them but do not error if > the IOCTL is supported. (But does the IOCTL being defined mean > it will work?) > Enumeration: > Do not assert the IOCTL while opening. > Serial.open: > assert the IOCTL after open. Continue to use locks as described > above after asserting the IOCTL. If the IOCTL is defined but > not working, handle it here. Failure cases include the IOCTL > is not supported and the port is already locked. > > On Mon, 28 Apr 2008, Stephen Davies wrote: > > > Has anybody done any design work on this? > > The first thing that springs to mind is that we still need > to check for lock > > files because other apps tend to use that approach even if > we go to ioctl. > > > > Cheers, > > Stephen Davies > > > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > >> Thanks Trent. > >> > >> Problem is only that I'm really not at all > >> Familiar with the C part of RXTX. If there > >> Were anything I could do in Java for this, > >> It would be easier for me.... > >> > >> ... Are there any C experts here on the list > >> Who'd like to look at ioctl port locking > >> For linux? > >> > >> Thanks, > >> -- > >> Martin Oberhuber, Senior Member of Technical Staff, Wind River > >> Target Management Project Lead, DSDP PMC Member > >> http://www.eclipse.org/dsdp/tm > >> > >>> -----Original Message----- > >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] > >>> Sent: Donnerstag, 24. April 2008 04:32 > >>> To: Oberhuber, Martin > >>> Cc: rxtx at qbang.org > >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? > >>> > >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > >>>> Dear RXTX community, > >>>> > >>>> I'm wondering what the status is with RXTX locking > >>>> serial ports on Linux? > >>>> > >>>> My understanding is that the mechanism used in > >>>> 2.1-7r2 (lockfiles) is not really state of the art, and > >>>> has lots of problems (e.g. missing permissions). > >>>> > >>>> There was an idea to migrate towards a Kernel > >>>> syscall based solution for port locking. > >>>> > >>>> What's the status here? > >>> > >>> Hi Martin, > >>> > >>> I'm in favor of deprecating the current FHS locking mechanism > >>> in favor of > >>> an IOCTL when available. I think it will be available on all the > >>> platforms but do not know for sure. > >>> > >>> The status is unchanged. I've had very few free cycles for > >>> such things. > >>> Feel free to take a stab at it if you have some time. I > >>> believe the IOCTL > >>> is used in the Mac OS X code already. > >>> > >>> I don't see any real backwards compatability issues and the > >>> IOCTL should > >>> just work. > >>> > >>> -- > >>> Trent Jarvi > >>> tjarvi at qbang.org > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > From Steffen.DETTMER at ingenico.com Tue Apr 29 13:34:44 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 29 Apr 2008 21:34:44 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Message-ID: <20080429193444.GU2928@elberon.bln.de.ingenico.com> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > The biggest problem that I have seen with lockfiles on Linux > At least is, that it seems there is no standard with respect > To the folder in which they should be created. Also, many > Distributions seem to set up file system permissions in such > A way that writing to the lockfile folder is not allowed for > The normal user -- that's why we stopped using lockfiles > In our commercial product. It seems it depends on the expectations. I consider it as a feature that by default a linux user cannot access serial ports. Maybe root connected a modem (can produce phone bills) or even some serial card reader, maybe with the web servers key pair. I would expect that by default a user cannot open the serial port because of insufficient permissions on the device file. I would expect this on other unices as well (but I don't know it). For windows I think it should be similar but not impacting so much in practice, because often windows users work with big permissions on a somewhat high priviledge level or even Administrator. > If we are to still respect lockfiles, we first need to > Understand where we are expected to look for them. Does > Anybody have any insight what variants of lockfile folder > Schema exist out there in the wild? Some apps like minicom > Seem to even allow users to manually specify a lockfile > Folder of their choice. At least my (ancient) minicom does not allow the user to change this option, it is displayed but read-only, but root is allowed to change it. > Because of the difficulty finding the right lockfile folder, > And because of the inherent risk of thinking that something > Might be locked while it actually isn't, I'd suggest that > RXTX should have a "soft-off" feature that allows disabling > ALL Lockfile checks at runtime without recompiling the native > Sharedlibs. sounds very reasonable, yes... and as admin I would not wish that users could skip such locking because they do things wrong by default ;) (in the end I guess that is related to the dilemma, that hotplug/user-owned-periphery and multi-user systems simply conflict) > Trent - I like your strategy outline, but I think that it > Needs to be configurable by the client such that users and/or > Customer Support can disable lockfiles / disable ioctl in > Case they detect that they are runing on an OS / Kernal that > Does not support one or the other. Yes, this would be good I guess... Applications could offer configuration options to control that, maybe similarily as minicom. BTW, man minicom tells: *B - Lock file location On most systems This should be /usr/spool/uucp. Linux systems use /var/lock. If this directory does not exist, minicom will not attempt to use lockfiles. The statement `Linux systems use /var/lock' is interesting, does anyone know the source of this convention? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Tue Apr 29 16:11:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Apr 2008 16:11:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? These details are outlined in the Filesystem Hierarchy Standard (FHS). http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLOCKLOCKFILES -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Tue Apr 29 18:58:09 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Wed, 30 Apr 2008 10:28:09 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: <200804301028.09307.scldad@sdc.com.au> I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is the same. Any ideas as to how to handle this? Stephen On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: > * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > > The biggest problem that I have seen with lockfiles on Linux > > At least is, that it seems there is no standard with respect > > To the folder in which they should be created. Also, many > > Distributions seem to set up file system permissions in such > > A way that writing to the lockfile folder is not allowed for > > The normal user -- that's why we stopped using lockfiles > > In our commercial product. > > It seems it depends on the expectations. I consider it as a > feature that by default a linux user cannot access serial ports. > Maybe root connected a modem (can produce phone bills) or even > some serial card reader, maybe with the web servers key pair. > > I would expect that by default a user cannot open the serial port > because of insufficient permissions on the device file. I would > expect this on other unices as well (but I don't know it). > > For windows I think it should be similar but not impacting so > much in practice, because often windows users work with big > permissions on a somewhat high priviledge level or even > Administrator. > > > If we are to still respect lockfiles, we first need to > > Understand where we are expected to look for them. Does > > Anybody have any insight what variants of lockfile folder > > Schema exist out there in the wild? Some apps like minicom > > Seem to even allow users to manually specify a lockfile > > Folder of their choice. > > At least my (ancient) minicom does not allow the user to change > this option, it is displayed but read-only, but root is allowed > to change it. > > > Because of the difficulty finding the right lockfile folder, > > And because of the inherent risk of thinking that something > > Might be locked while it actually isn't, I'd suggest that > > RXTX should have a "soft-off" feature that allows disabling > > ALL Lockfile checks at runtime without recompiling the native > > Sharedlibs. > > sounds very reasonable, yes... > and as admin I would not wish that users could skip such > locking because they do things wrong by default ;) > > (in the end I guess that is related to the dilemma, that > hotplug/user-owned-periphery and multi-user systems simply > conflict) > > > Trent - I like your strategy outline, but I think that it > > Needs to be configurable by the client such that users and/or > > Customer Support can disable lockfiles / disable ioctl in > > Case they detect that they are runing on an OS / Kernal that > > Does not support one or the other. > > Yes, this would be good I guess... Applications could offer > configuration options to control that, maybe similarily as > minicom. > > BTW, man minicom tells: > > *B - Lock file location > On most systems This should be /usr/spool/uucp. > Linux systems use /var/lock. If this directory > does not exist, minicom will not attempt to use > lockfiles. > > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure > and expedient electronic transaction acceptance. Ingenico products leverage > proven technology, established standards and unparalleled ergonomics to > provide optimal reliability, versatility and usability. This comprehensive > range of products is complemented by a global array of services and > partnerships, enabling businesses in a number of vertical sectors to accept > transactions anywhere their business takes them. www.ingenico.com This > message may contain confidential and/or privileged information. If you are > not the addressee or authorized to receive this for the addressee, you must > not use, copy, disclose or take any action based on this message or any > information herein. If you have received this message in error, please > advise the sender immediately by reply e-mail and delete this message. > Thank you for your cooperation. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Wed Apr 30 19:30:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 30 Apr 2008 19:30:51 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804301028.09307.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> <200804301028.09307.scldad@sdc.com.au> Message-ID: Hi Stephen, I suspect ioctl/TIOCEXCL open/O_EXCL would do the job. Mac uses TIOCEXCL and it is POSIX. We use O_EXCL for lockfiles on Linux already. On Wed, 30 Apr 2008, Stephen Davies wrote: > I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is > the same. > > Any ideas as to how to handle this? > > Stephen > > > On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: >> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: >>> The biggest problem that I have seen with lockfiles on Linux >>> At least is, that it seems there is no standard with respect >>> To the folder in which they should be created. Also, many >>> Distributions seem to set up file system permissions in such >>> A way that writing to the lockfile folder is not allowed for >>> The normal user -- that's why we stopped using lockfiles >>> In our commercial product. >> >> It seems it depends on the expectations. I consider it as a >> feature that by default a linux user cannot access serial ports. >> Maybe root connected a modem (can produce phone bills) or even >> some serial card reader, maybe with the web servers key pair. >> >> I would expect that by default a user cannot open the serial port >> because of insufficient permissions on the device file. I would >> expect this on other unices as well (but I don't know it). >> >> For windows I think it should be similar but not impacting so >> much in practice, because often windows users work with big >> permissions on a somewhat high priviledge level or even >> Administrator. >> >>> If we are to still respect lockfiles, we first need to >>> Understand where we are expected to look for them. Does >>> Anybody have any insight what variants of lockfile folder >>> Schema exist out there in the wild? Some apps like minicom >>> Seem to even allow users to manually specify a lockfile >>> Folder of their choice. >> >> At least my (ancient) minicom does not allow the user to change >> this option, it is displayed but read-only, but root is allowed >> to change it. >> >>> Because of the difficulty finding the right lockfile folder, >>> And because of the inherent risk of thinking that something >>> Might be locked while it actually isn't, I'd suggest that >>> RXTX should have a "soft-off" feature that allows disabling >>> ALL Lockfile checks at runtime without recompiling the native >>> Sharedlibs. >> >> sounds very reasonable, yes... >> and as admin I would not wish that users could skip such >> locking because they do things wrong by default ;) >> >> (in the end I guess that is related to the dilemma, that >> hotplug/user-owned-periphery and multi-user systems simply >> conflict) >> >>> Trent - I like your strategy outline, but I think that it >>> Needs to be configurable by the client such that users and/or >>> Customer Support can disable lockfiles / disable ioctl in >>> Case they detect that they are runing on an OS / Kernal that >>> Does not support one or the other. >> >> Yes, this would be good I guess... Applications could offer >> configuration options to control that, maybe similarily as >> minicom. >> >> BTW, man minicom tells: >> >> *B - Lock file location >> On most systems This should be /usr/spool/uucp. >> Linux systems use /var/lock. If this directory >> does not exist, minicom will not attempt to use >> lockfiles. >> >> The statement `Linux systems use /var/lock' is interesting, does >> anyone know the source of this convention? >> >> oki, >> >> Steffen >> >> About Ingenico Throughout the world businesses rely on Ingenico for secure >> and expedient electronic transaction acceptance. Ingenico products leverage >> proven technology, established standards and unparalleled ergonomics to >> provide optimal reliability, versatility and usability. This comprehensive >> range of products is complemented by a global array of services and >> partnerships, enabling businesses in a number of vertical sectors to accept >> transactions anywhere their business takes them. www.ingenico.com This >> message may contain confidential and/or privileged information. If you are >> not the addressee or authorized to receive this for the addressee, you must >> not use, copy, disclose or take any action based on this message or any >> information herein. If you have received this message in error, please >> advise the sender immediately by reply e-mail and delete this message. >> Thank you for your cooperation. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0051.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0049.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0036.html From pboulton at pulsetracer.com Fri Apr 18 14:30:13 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Fri, 18 Apr 2008 13:30:13 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site Message-ID: <480904D5.1060307@pulsetracer.com> Hello, gentle serial porters. I have downloaded the zipped up binaries for use on Windows without Sun's CommAPI, but don't seem able to extract anything from the download. Go to main page, http://www.rxtx.org/ Click on Downloads I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) And I save it to disk. If I try and extract the files with WinZip, Winzip thinks the archive is corrupt. If I try using Windows Explorer, I am able to extract it into a single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than the original .zip. Any help would be much appreciated. Sincerely, Philip Boulton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080418/97d89793/attachment-0034.html From tjarvi at qbang.org Fri Apr 18 19:07:00 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 18 Apr 2008 19:07:00 -0600 (MDT) Subject: [Rxtx] Difficulty opening zip file at rxtx site In-Reply-To: <480904D5.1060307@pulsetracer.com> References: <480904D5.1060307@pulsetracer.com> Message-ID: On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org From pboulton at pulsetracer.com Sat Apr 19 12:46:26 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Sat, 19 Apr 2008 11:46:26 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site References: <480904D5.1060307@pulsetracer.com> Message-ID: <53DB7576450695419E09299104043761A78533@ZTGSERVER.ztg.local> I have been able to get my hands on the binaries, by going to the ftp directory /pub/rxtx at ftp.qbang.org,, and ftping the file rxtx-2.1-7-bins-r2.zip . This opens happily with Winzip, and extracts as the set of files that you describe below. I only experience the ill-formed archive problem by clicking the link on the rxtx.org Downloads page (http://rxtx.qbang.org/pub/rxtx/ rxtx-2.1-7-bins-r2.zip ). Not sure what to make of that. Philip Boulton ________________________________ From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Fri 4/18/2008 6:07 PM To: Philip Boulton Cc: rxtx at qbang.org Subject: Re: [Rxtx] Difficulty opening zip file at rxtx site On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080419/147923bb/attachment-0033.html From jlar310 at gmail.com Sat Apr 19 19:11:55 2008 From: jlar310 at gmail.com (Jeff Larsen) Date: Sat, 19 Apr 2008 20:11:55 -0500 Subject: [Rxtx] Moxa serial over Ethernet driver Message-ID: Hi all, I've been using javax.comm for years to communicate with a legacy radio data system. We want to migrate the java side of the system to a VMware Server virtual machine. We've had great success using Moxa DE-303 and 5610 serial over Ethernet appliances and virtual machines for running hylafax. The OS (Linux in this case) uses a kernel driver to communicate with the Moxa via a virtual serial port such as /dev/ttyr00. I want to do the same thing with javax.comm or gnu.io to connect to a virtual serial port. However I'm hitting road blocks everywhere. javax.comm for Linux sees the virtual port, but there are transmission errors. Tried Solaris too, but the Solaris Moxa drivers don't play nice with javax.comm because the driver uses /dev/pts/n instead of /dev/term/x. Next I tried RXTX on Linux, but I'm getting NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX on Solaris. Has anyone used RXTX with serial over Ethernet devices? Any hints on how to make it work? I know that I'm not completely off track because javax.comm does work with Moxa on a Windows platform, but that's just not an option for production deployment. -- Jeff From tjarvi at qbang.org Sat Apr 19 21:08:41 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 19 Apr 2008 21:08:41 -0600 (MDT) Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: yOn Sat, 19 Apr 2008, Jeff Larsen wrote: > Hi all, > > I've been using javax.comm for years to communicate with a legacy > radio data system. We want to migrate the java side of the system to a > VMware Server virtual machine. We've had great success using Moxa > DE-303 and 5610 serial over Ethernet appliances and virtual machines > for running hylafax. The OS (Linux in this case) uses a kernel driver > to communicate with the Moxa via a virtual serial port such as > /dev/ttyr00. > > I want to do the same thing with javax.comm or gnu.io to connect to a > virtual serial port. However I'm hitting road blocks everywhere. > javax.comm for Linux sees the virtual port, but there are transmission > errors. Tried Solaris too, but the Solaris Moxa drivers don't play > nice with javax.comm because the driver uses /dev/pts/n instead of > /dev/term/x. Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris. > > Has anyone used RXTX with serial over Ethernet devices? Any hints on > how to make it work? > > I know that I'm not completely off track because javax.comm does work > with Moxa on a Windows platform, but that's just not an option for > production deployment. > > Moxa should work under linux. There may be minor issues depending upon how complete the kernel driver is but I think it will work. One of the minor issues is /dev/ttyr00 is not enumerated. There are several work arounds documented with the source code and on the wiki. The easiest solution for testing purposes is to make a symbolic link from /dev/ttyr00 to a port that is enumerated such as /dev/ttyS129. You can later alter the rxtx source or use properties to change the enumerated ports. -- Trent Jarvi tjarvi at qbang.org From d.tonhofer at m-plify.com Sun Apr 20 03:33:30 2008 From: d.tonhofer at m-plify.com (David Tonhofer (M-PLIFY S.A.)) Date: Sun, 20 Apr 2008 11:33:30 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: <480B0DEA.5010908@m-plify.com> Jeff Larsen wrote: > Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris It might be that the Java side of RXTX does not recognize that portname. Trying modifying src/RXTXCommDriver.java as described in this case: http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card From ajmas at sympatico.ca Sun Apr 20 16:37:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Apr 2008 18:37:59 -0400 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <480B0DEA.5010908@m-plify.com> References: <480B0DEA.5010908@m-plify.com> Message-ID: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > Jeff Larsen wrote: >> Next I tried RXTX on Linux, but I'm getting >> NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX >> on Solaris > It might be that the Java side of RXTX does not recognize that > portname. > Trying modifying src/RXTXCommDriver.java as described in this case: > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card I wonder whether it would be worth allowing custom port prefixes as a system parameter? For example: gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" Andre From Martin.Oberhuber at windriver.com Tue Apr 22 12:34:36 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 22 Apr 2008 20:34:36 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> References: <480B0DEA.5010908@m-plify.com> <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE6485848056CD6CE@ism-mail03.corp.ad.wrs.com> Sounds like a great idea... I'm wondering how the "variable part" after the Prefixes could be specified though? What about allowing Regular Expression character Classes in the existing System Property for specifying ports: System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyS[0-9],ttyS[ABC],ttyUSB[0-9a-z]"); The set of allowed patterns would of course need to Be restricted compared to REGEX, because it must be A syntax that supports iterating over it. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Montag, 21. April 2008 00:38 > To: rxtx at qbang.org and Users > Subject: Re: [Rxtx] Moxa serial over Ethernet driver > > > On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > > Jeff Larsen wrote: > >> Next I tried RXTX on Linux, but I'm getting > >> NoSuchPortException connecting to /dev/ttyr00. I have yet > to try RXTX > >> on Solaris > > It might be that the Java side of RXTX does not recognize that > > portname. > > Trying modifying src/RXTXCommDriver.java as described in this case: > > > > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_ > SST-4P.2FLP_multiport_card > > I wonder whether it would be worth allowing custom port > prefixes as a > system parameter? For > example: > > gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Loi.TRAN at weatherford.com Tue Apr 22 13:10:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Tue, 22 Apr 2008 14:10:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled Message-ID: Hi, I'm currently using the Java RXTX API to interface to a serial port. The serial port is connected to a bridge board that communicates with our communications system running at 1.875 Mbps which is linked to an embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no flow control). I send a command to the embedded board through the serial-bridge board which then is relayed to the embedded board. The command sent asks the embedded board to dump a binary image. Here's where I'm hitting some problems. I've successfully done this is an integrated serial port from the laptop. The binary file that comes back is consistent on every attempt. When I use the application I've written to do the same thing with a USB-to-serial adapter, the image I get back is not the same as the image I receive through the USB-to-serial adapter is not consistent at all. A final thing is that when I use a terminal program to dump the binary image with the USB-serial adapter, the image is correct. Every time! What is the terminal program doing that's not being done in my application? My application is quite simple. Has anyone observed this behavior before? If you have, I'd like to know how you've gotten around this problem. Thanks, LT =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From tjarvi at qbang.org Tue Apr 22 21:11:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 22 Apr 2008 21:11:10 -0600 (MDT) Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org From Loi.TRAN at weatherford.com Wed Apr 23 08:35:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Wed, 23 Apr 2008 09:35:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: Thanks for all the responses. I finally tried something that worked consistently. I updated my Prolific driver and repeated my tests. It worked. If you're using the Prolific type USB-serial adapters, do no use the Prolific version 2.0.2.1 driver on Windows. Update it to the latest 2.0.2.8 version. Again, thanks for all the responses. LT -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Tuesday, April 22, 2008 10:11 PM To: TRAN, Loi X. Cc: rxtx at qbang.org Subject: Re: [Rxtx] Prolific USB - RXTX data mangled On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From Martin.Oberhuber at windriver.com Wed Apr 23 18:54:26 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 02:54:26 +0200 Subject: [Rxtx] RXTX port locking on Linux status? Message-ID: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Dear RXTX community, I'm wondering what the status is with RXTX locking serial ports on Linux? My understanding is that the mechanism used in 2.1-7r2 (lockfiles) is not really state of the art, and has lots of problems (e.g. missing permissions). There was an idea to migrate towards a Kernel syscall based solution for port locking. What's the status here? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/9878db9f/attachment-0029.html From tjarvi at qbang.org Wed Apr 23 20:32:24 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Apr 2008 20:32:24 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > Dear RXTX community, > > I'm wondering what the status is with RXTX locking > serial ports on Linux? > > My understanding is that the mechanism used in > 2.1-7r2 (lockfiles) is not really state of the art, and > has lots of problems (e.g. missing permissions). > > There was an idea to migrate towards a Kernel > syscall based solution for port locking. > > What's the status here? > Hi Martin, I'm in favor of deprecating the current FHS locking mechanism in favor of an IOCTL when available. I think it will be available on all the platforms but do not know for sure. The status is unchanged. I've had very few free cycles for such things. Feel free to take a stab at it if you have some time. I believe the IOCTL is used in the Mac OS X code already. I don't see any real backwards compatability issues and the IOCTL should just work. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Apr 24 06:14:06 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 14:14:06 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Thanks Trent. Problem is only that I'm really not at all Familiar with the C part of RXTX. If there Were anything I could do in Java for this, It would be easier for me.... ... Are there any C experts here on the list Who'd like to look at ioctl port locking For linux? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Donnerstag, 24. April 2008 04:32 > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > I'm wondering what the status is with RXTX locking > > serial ports on Linux? > > > > My understanding is that the mechanism used in > > 2.1-7r2 (lockfiles) is not really state of the art, and > > has lots of problems (e.g. missing permissions). > > > > There was an idea to migrate towards a Kernel > > syscall based solution for port locking. > > > > What's the status here? > > > > Hi Martin, > > I'm in favor of deprecating the current FHS locking mechanism > in favor of > an IOCTL when available. I think it will be available on all the > platforms but do not know for sure. > > The status is unchanged. I've had very few free cycles for > such things. > Feel free to take a stab at it if you have some time. I > believe the IOCTL > is used in the Mac OS X code already. > > I don't see any real backwards compatability issues and the > IOCTL should > just work. > > -- > Trent Jarvi > tjarvi at qbang.org > From sspies at sloc.de Thu Apr 24 07:15:36 2008 From: sspies at sloc.de (Sebastian Spies) Date: Thu, 24 Apr 2008 15:15:36 +0200 (CEST) Subject: [Rxtx] rxtx on gumstix: Interrupted system call In-Reply-To: <47FB7B20.7080504@sloc.de> References: <47FB7B20.7080504@sloc.de> Message-ID: <55445.130.83.139.205.1209042936.squirrel@ssl.sloc.de> Dear list, while porting rxtx to the gumstix, I found out, that select used in readArray in SerialImp.c might not work as expected. Maybe, because of missing TIOCSERGETLSR-support? select is often interrupted, so i wrote the following quick'n'dirty hack to make it work on gumstix: diff -Nur rxtx-2.1-7r2/src/SerialImp.c rxtx-2.1-7r2/src/SerialImp.c --- rxtx-2.1-7r2/src/SerialImp.c 2006-01-29 23:19:04.000000000 +0100 +++ rxtx-2.1-7r2-patched/src/SerialImp.c 2008-04-24 14:30:17.000000000 +0200 @@ -3380,7 +3381,7 @@ JNIEXPORT jint JNICALL RXTXPort(readArray)( JNIEnv *env, jobject jobj, jbyteArray jbarray, jint offset, jint length ) { - int bytes; + int bytes = 0; jbyte *body; /* char msg[80]; */ int fd = get_java_var( env, jobj, "fd", "I" ); @@ -3397,9 +3398,18 @@ "readArray", "Invalid length" ); return -1; } - body = (*env)->GetByteArrayElements( env, jbarray, 0 ); - bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ - (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + while(1 > bytes) + { + body = (*env)->GetByteArrayElements( env, jbarray, 0 ); + bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ + (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + // quick'n'dirty - SSP + report (" trying again... \n"); + errno = 0; + } + if( bytes < 0 ) { report( "RXTXPort:readArray bytes < 0" ); LEAVE( "RXTXPort:readArray" ); > Hey, > > I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use > RXTXPort$SerialInputStream.read(), then I get the following Exception. I > did not yet figure out which system call is interrupted as strace > produces loads of output. > > Any help would be very appreciated. Thanks in advance. > Sebastian > > > [java] java.io.IOException: Interrupted system call in readArray > [java] at gnu.io.RXTXPort.readArray(Native Method) > [java] at > gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) > [java] at > java.io.FilterInputStream.read(FilterInputStream.java:189) > [java] at > java.io.BufferedInputStream.refill(BufferedInputStream.java:371) > [java] at > java.io.BufferedInputStream.read(BufferedInputStream.java:229) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) > [java] at > com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) > > -- > Sebastian Spies > > mail: sspies at sloc.de > > > > From fire_baptized at hotmail.com Thu Apr 24 18:27:48 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Thu, 24 Apr 2008 20:27:48 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hello I am having a problem with the serial device connecting (software wise) to the serial port. However I have a test program and it seems to work just fine in that environment - and it doesnt use GUI. The error I am getting is : PortNotFoundException Now the way I have it setup in the GUI environment is that once the user pushes a JButton the program connects using this class: protected void establishConnection() { try { portId = CommPortIdentifier.getPortIdentifier("COM3"); System.out.println("Establishing connction....."); messages[0] = "\nEstablishing connction.....\n"; } catch ( NoSuchPortException noport) { System.out.println("Port not found: "+ noport); messages[0] = "Port not found: "+ noport+"\n"; } try { serialPort = (SerialPort) portId.open("serial", 50); System.out.println("Port has been found."); messages[1] = "Port has been found.\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[1] = "" +usedport; } try { serialPort = (SerialPort) portId.open("serial", 50); messages[2] = "Connecting to COM3 on port 50....\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; } try { serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); System.out.println("Esablishing the transfer rate settings for COM3."); messages[3] = "Esablishing the transfer rate settings for COM3.\n"; } catch (UnsupportedCommOperationException nosupcom) { System.out.println(nosupcom); System.out.println("The tranfer rate could not be esblished on COM3."); messages[3] = "The tranfer rate could not be esblished on COM3.\n"; } System.out.println(serialPort.getFlowControlMode()); messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; //sendDataOut(buffer[3],buffer[4]); } I need all the data in this method (and all the string values in this method) to be printed out on a JTextArea. I wont do me any good if not all the text is printed on a JTextArea in another class. So I have the text printing the JTextArea correctly, but everytime the JButton is activated - it gives me that error message. I did add a disconnect button that is supposed to call the serialPort.close(). _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/273fd4ec/attachment-0028.html From tjarvi at qbang.org Thu Apr 24 21:54:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Apr 2008 21:54:10 -0600 (MDT) Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > Hello I am having a problem with the serial device connecting (software > wise) to the serial port. However I have a test program and it seems to > work just fine in that environment - and it doesnt use GUI. The error I > am getting is : PortNotFoundException Now the way I have it setup in the > GUI environment is that once the user pushes a JButton the program > connects using this class: > > protected void establishConnection() { > try { > portId = CommPortIdentifier.getPortIdentifier("COM3"); > System.out.println("Establishing connction....."); > messages[0] = "\nEstablishing connction.....\n"; > } > catch ( NoSuchPortException noport) { > System.out.println("Port not found: "+ noport); > messages[0] = "Port not found: "+ noport+"\n"; > } > try { > serialPort = (SerialPort) portId.open("serial", 50); > System.out.println("Port has been found."); > messages[1] = "Port has been found.\n"; > } > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[1] = "" +usedport; > } ================================================================= > try { > serialPort = (SerialPort) portId.open("serial", 50); > messages[2] = "Connecting to COM3 on port 50....\n"; > } ================================================================== > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > } > try { > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > System.out.println("Esablishing the transfer rate settings for COM3."); > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > } > catch (UnsupportedCommOperationException nosupcom) { > System.out.println(nosupcom); > System.out.println("The tranfer rate could not be esblished on COM3."); > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > } > System.out.println(serialPort.getFlowControlMode()); > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > //sendDataOut(buffer[3],buffer[4]); > } > > I need all the data in this method (and all the string values in this > method) to be printed out on a JTextArea. I wont do me any good if not > all the text is printed on a JTextArea in another class. So I have the > text printing the JTextArea correctly, but everytime the JButton is > activated - it gives me that error message. I did add a disconnect > button that is supposed to call the serialPort.close(). > The open code used twice is going to throw an exception. It may be that you catch the exception above this code and print a confusing message? A common mistake is people will accidently run two copies of their program. The first instance of the program will open the port and prevent enumeration (finding the port) in the second instance of the program. As an example, you may be running your text based application which is preventing the GUI from seeing the port. Enumeration is done by trying to open the port. If the port is open, Enumeration fails. -- Trent Jarvi tjarvi at qbang.org From fire_baptized at hotmail.com Thu Apr 24 22:32:05 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 00:32:05 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Wow - thanks dude what a dumb thing for me to not catch..... now here is the current problem - right now I am trying to output data again one is with the test program - and it seems that serialPort.setRTS(true); is throwing an exceptions there - now if I show this code please bare in mind that I am only testing - the code is kinda sloppy in my mind - but if I can figure out why calling this function is throwing an exception then maybe I can figure out why my GUI application is getting the same null pointer exceptions when try to send out the data stream. FYI Trent this email is not directed towards you - anyone can jump in on this public static void main(String args[]) { byte[] b = new byte[64]; int keyinput = 0 ; byte x = 0; byte y = 0; PortTesting1 testports = new PortTesting1(); try { joyskoro = Joystick.createInstance(); } catch (IOException ioexc) { System.out.println("There is an input/output problem: " + ioexc); } while (true) { joyskoro.poll(); b[0] = ((byte) -(10 * joyskoro.getY())); b[1] = ((byte) (10 * joyskoro.getX())); System.out.println("The 3rd byte is: " +b[0]); System.out.println("The 4rd byte is: " +b[1]); serialPort.setRTS(true); // HERE IS WHERE THE PROBLEM IS !!!!!!! ON THIS LINE but if I dont have it active in my program the Bluetooth device (that is System.out.println("Ready to send :-) !"); //connected to the serial port does not send out data!!!!! if (joyskoro.isButtonDown(joyskoro.BUTTON10)) { System.out.println("Connection terminated."); serialPort.close(); break; } if (joyskoro.isButtonDown(joyskoro.BUTTON2)) { boolean flag = true; //reading from key input from the keyboard System.out.println("Please input a command: "); while (flag) { try { keyinput = System.in.read(); } catch (IOException ioexc) {/*there is no need to put * anything here */ } if((char)keyinput=='w') { pushIt((byte)85); } if((char)keyinput=='s') { pushIt((byte)84); } if((char)keyinput=='a') { pushIt((byte)83); } if((char)keyinput=='d') { pushIt((byte)82); } if((char)keyinput=='q') { pushIt((byte)89); } if((char)keyinput=='\t') { //this stop reading input from the keyboard flag = false; } } and help anyways here is the block of code that throwing an exception for the test program: > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/5c8f7d68/attachment-0028.html From fire_baptized at hotmail.com Fri Apr 25 07:59:53 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 09:59:53 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Are there any examples of how to push out data? As in using input and output streams - if I can compare code maybe I can see where this is causing a problem. I have a byte array that I am pushing out data. I keep getting null pointer exceptions every where I turn. > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/22228ab6/attachment-0027.html From ajmas at sympatico.ca Sat Apr 26 07:37:09 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 26 Apr 2008 09:37:09 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hi, On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote: > > Are there any examples of how to push out data? As in using input > and output streams - if I can compare code maybe I can see where > this is causing a problem. I have a byte array that I am pushing > out data. I keep getting null pointer exceptions every where I turn. > There are some examples here that might be of help: http://rxtx.qbang.org/wiki/index.php/Examples Andre From fire_baptized at hotmail.com Sat Apr 26 20:13:54 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Sat, 26 Apr 2008 22:13:54 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: looked at those....yep didnt help - I need to push out data with GUI and not get a null pointer exception everytime I try. > CC: rxtx at qbang.org> From: ajmas at sympatico.ca> To: fire_baptized at hotmail.com> Subject: Re: [Rxtx] Serial Problems with Gui.....> Date: Sat, 26 Apr 2008 09:37:09 -0400> > Hi,> > > On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote:> >> > Are there any examples of how to push out data? As in using input > > and output streams - if I can compare code maybe I can see where > > this is causing a problem. I have a byte array that I am pushing > > out data. I keep getting null pointer exceptions every where I turn.> >> > There are some examples here that might be of help:> > http://rxtx.qbang.org/wiki/index.php/Examples> > Andre _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080426/09f95b41/attachment-0026.html From michael.erskine at ketech.com Mon Apr 28 02:47:22 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 28 Apr 2008 09:47:22 +0100 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D426EF3CBBC5@no-sv-03.ketech.local> Jesrael D. Summerhill wrote: > looked at those....yep didnt help - I need to push out data with GUI and > not get a null pointer exception everytime I try. So it seems pretty obvious that your code needs to check for nulls wherever one may occur and report what's happening. Alternatively, catch the npe and display the stack trace. Then you can fix your code so it doesn't try to work with something that ain't there. Regards, Michael Erskine. From scldad at sdc.com.au Mon Apr 28 03:58:34 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Mon, 28 Apr 2008 19:28:34 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Message-ID: <200804281928.34454.scldad@sdc.com.au> Has anybody done any design work on this? The first thing that springs to mind is that we still need to check for lock files because other apps tend to use that approach even if we go to ioctl. Cheers, Stephen Davies On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > Thanks Trent. > > Problem is only that I'm really not at all > Familiar with the C part of RXTX. If there > Were anything I could do in Java for this, > It would be easier for me.... > > ... Are there any C experts here on the list > Who'd like to look at ioctl port locking > For linux? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > -----Original Message----- > > From: Trent Jarvi [mailto:tjarvi at qbang.org] > > Sent: Donnerstag, 24. April 2008 04:32 > > To: Oberhuber, Martin > > Cc: rxtx at qbang.org > > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > > > I'm wondering what the status is with RXTX locking > > > serial ports on Linux? > > > > > > My understanding is that the mechanism used in > > > 2.1-7r2 (lockfiles) is not really state of the art, and > > > has lots of problems (e.g. missing permissions). > > > > > > There was an idea to migrate towards a Kernel > > > syscall based solution for port locking. > > > > > > What's the status here? > > > > Hi Martin, > > > > I'm in favor of deprecating the current FHS locking mechanism > > in favor of > > an IOCTL when available. I think it will be available on all the > > platforms but do not know for sure. > > > > The status is unchanged. I've had very few free cycles for > > such things. > > Feel free to take a stab at it if you have some time. I > > believe the IOCTL > > is used in the Mac OS X code already. > > > > I don't see any real backwards compatability issues and the > > IOCTL should > > just work. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Mon Apr 28 04:21:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 28 Apr 2008 04:21:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804281928.34454.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: I don't think there would need to be any architectural changes. A couple ifdefs and minor changes in the current code should be enough. Proposal: FHS/UUCP locks: continue to respect them, try to create them but do not error if the IOCTL is supported. (But does the IOCTL being defined mean it will work?) Enumeration: Do not assert the IOCTL while opening. Serial.open: assert the IOCTL after open. Continue to use locks as described above after asserting the IOCTL. If the IOCTL is defined but not working, handle it here. Failure cases include the IOCTL is not supported and the port is already locked. On Mon, 28 Apr 2008, Stephen Davies wrote: > Has anybody done any design work on this? > The first thing that springs to mind is that we still need to check for lock > files because other apps tend to use that approach even if we go to ioctl. > > Cheers, > Stephen Davies > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: >> Thanks Trent. >> >> Problem is only that I'm really not at all >> Familiar with the C part of RXTX. If there >> Were anything I could do in Java for this, >> It would be easier for me.... >> >> ... Are there any C experts here on the list >> Who'd like to look at ioctl port locking >> For linux? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >>> -----Original Message----- >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] >>> Sent: Donnerstag, 24. April 2008 04:32 >>> To: Oberhuber, Martin >>> Cc: rxtx at qbang.org >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? >>> >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: >>>> Dear RXTX community, >>>> >>>> I'm wondering what the status is with RXTX locking >>>> serial ports on Linux? >>>> >>>> My understanding is that the mechanism used in >>>> 2.1-7r2 (lockfiles) is not really state of the art, and >>>> has lots of problems (e.g. missing permissions). >>>> >>>> There was an idea to migrate towards a Kernel >>>> syscall based solution for port locking. >>>> >>>> What's the status here? >>> >>> Hi Martin, >>> >>> I'm in favor of deprecating the current FHS locking mechanism >>> in favor of >>> an IOCTL when available. I think it will be available on all the >>> platforms but do not know for sure. >>> >>> The status is unchanged. I've had very few free cycles for >>> such things. >>> Feel free to take a stab at it if you have some time. I >>> believe the IOCTL >>> is used in the Mac OS X code already. >>> >>> I don't see any real backwards compatability issues and the >>> IOCTL should >>> just work. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Tue Apr 29 12:04:04 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Apr 2008 20:04:04 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Hi all, The biggest problem that I have seen with lockfiles on Linux At least is, that it seems there is no standard with respect To the folder in which they should be created. Also, many Distributions seem to set up file system permissions in such A way that writing to the lockfile folder is not allowed for The normal user -- that's why we stopped using lockfiles In our commercial product. If we are to still respect lockfiles, we first need to Understand where we are expected to look for them. Does Anybody have any insight what variants of lockfile folder Schema exist out there in the wild? Some apps like minicom Seem to even allow users to manually specify a lockfile Folder of their choice. Because of the difficulty finding the right lockfile folder, And because of the inherent risk of thinking that something Might be locked while it actually isn't, I'd suggest that RXTX should have a "soft-off" feature that allows disabling ALL Lockfile checks at runtime without recompiling the native Sharedlibs. Trent - I like your strategy outline, but I think that it Needs to be configurable by the client such that users and/or Customer Support can disable lockfiles / disable ioctl in Case they detect that they are runing on an OS / Kernal that Does not support one or the other. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Montag, 28. April 2008 12:22 > To: Stephen Davies > Cc: rxtx at qbang.org; Oberhuber, Martin; Trent Jarvi > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > I don't think there would need to be any architectural > changes. A couple > ifdefs and minor changes in the current code should be enough. > > Proposal: > > FHS/UUCP locks: > continue to respect them, try to create them but do not error if > the IOCTL is supported. (But does the IOCTL being defined mean > it will work?) > Enumeration: > Do not assert the IOCTL while opening. > Serial.open: > assert the IOCTL after open. Continue to use locks as described > above after asserting the IOCTL. If the IOCTL is defined but > not working, handle it here. Failure cases include the IOCTL > is not supported and the port is already locked. > > On Mon, 28 Apr 2008, Stephen Davies wrote: > > > Has anybody done any design work on this? > > The first thing that springs to mind is that we still need > to check for lock > > files because other apps tend to use that approach even if > we go to ioctl. > > > > Cheers, > > Stephen Davies > > > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > >> Thanks Trent. > >> > >> Problem is only that I'm really not at all > >> Familiar with the C part of RXTX. If there > >> Were anything I could do in Java for this, > >> It would be easier for me.... > >> > >> ... Are there any C experts here on the list > >> Who'd like to look at ioctl port locking > >> For linux? > >> > >> Thanks, > >> -- > >> Martin Oberhuber, Senior Member of Technical Staff, Wind River > >> Target Management Project Lead, DSDP PMC Member > >> http://www.eclipse.org/dsdp/tm > >> > >>> -----Original Message----- > >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] > >>> Sent: Donnerstag, 24. April 2008 04:32 > >>> To: Oberhuber, Martin > >>> Cc: rxtx at qbang.org > >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? > >>> > >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > >>>> Dear RXTX community, > >>>> > >>>> I'm wondering what the status is with RXTX locking > >>>> serial ports on Linux? > >>>> > >>>> My understanding is that the mechanism used in > >>>> 2.1-7r2 (lockfiles) is not really state of the art, and > >>>> has lots of problems (e.g. missing permissions). > >>>> > >>>> There was an idea to migrate towards a Kernel > >>>> syscall based solution for port locking. > >>>> > >>>> What's the status here? > >>> > >>> Hi Martin, > >>> > >>> I'm in favor of deprecating the current FHS locking mechanism > >>> in favor of > >>> an IOCTL when available. I think it will be available on all the > >>> platforms but do not know for sure. > >>> > >>> The status is unchanged. I've had very few free cycles for > >>> such things. > >>> Feel free to take a stab at it if you have some time. I > >>> believe the IOCTL > >>> is used in the Mac OS X code already. > >>> > >>> I don't see any real backwards compatability issues and the > >>> IOCTL should > >>> just work. > >>> > >>> -- > >>> Trent Jarvi > >>> tjarvi at qbang.org > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > From Steffen.DETTMER at ingenico.com Tue Apr 29 13:34:44 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 29 Apr 2008 21:34:44 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Message-ID: <20080429193444.GU2928@elberon.bln.de.ingenico.com> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > The biggest problem that I have seen with lockfiles on Linux > At least is, that it seems there is no standard with respect > To the folder in which they should be created. Also, many > Distributions seem to set up file system permissions in such > A way that writing to the lockfile folder is not allowed for > The normal user -- that's why we stopped using lockfiles > In our commercial product. It seems it depends on the expectations. I consider it as a feature that by default a linux user cannot access serial ports. Maybe root connected a modem (can produce phone bills) or even some serial card reader, maybe with the web servers key pair. I would expect that by default a user cannot open the serial port because of insufficient permissions on the device file. I would expect this on other unices as well (but I don't know it). For windows I think it should be similar but not impacting so much in practice, because often windows users work with big permissions on a somewhat high priviledge level or even Administrator. > If we are to still respect lockfiles, we first need to > Understand where we are expected to look for them. Does > Anybody have any insight what variants of lockfile folder > Schema exist out there in the wild? Some apps like minicom > Seem to even allow users to manually specify a lockfile > Folder of their choice. At least my (ancient) minicom does not allow the user to change this option, it is displayed but read-only, but root is allowed to change it. > Because of the difficulty finding the right lockfile folder, > And because of the inherent risk of thinking that something > Might be locked while it actually isn't, I'd suggest that > RXTX should have a "soft-off" feature that allows disabling > ALL Lockfile checks at runtime without recompiling the native > Sharedlibs. sounds very reasonable, yes... and as admin I would not wish that users could skip such locking because they do things wrong by default ;) (in the end I guess that is related to the dilemma, that hotplug/user-owned-periphery and multi-user systems simply conflict) > Trent - I like your strategy outline, but I think that it > Needs to be configurable by the client such that users and/or > Customer Support can disable lockfiles / disable ioctl in > Case they detect that they are runing on an OS / Kernal that > Does not support one or the other. Yes, this would be good I guess... Applications could offer configuration options to control that, maybe similarily as minicom. BTW, man minicom tells: *B - Lock file location On most systems This should be /usr/spool/uucp. Linux systems use /var/lock. If this directory does not exist, minicom will not attempt to use lockfiles. The statement `Linux systems use /var/lock' is interesting, does anyone know the source of this convention? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Tue Apr 29 16:11:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Apr 2008 16:11:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? These details are outlined in the Filesystem Hierarchy Standard (FHS). http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLOCKLOCKFILES -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Tue Apr 29 18:58:09 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Wed, 30 Apr 2008 10:28:09 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: <200804301028.09307.scldad@sdc.com.au> I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is the same. Any ideas as to how to handle this? Stephen On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: > * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > > The biggest problem that I have seen with lockfiles on Linux > > At least is, that it seems there is no standard with respect > > To the folder in which they should be created. Also, many > > Distributions seem to set up file system permissions in such > > A way that writing to the lockfile folder is not allowed for > > The normal user -- that's why we stopped using lockfiles > > In our commercial product. > > It seems it depends on the expectations. I consider it as a > feature that by default a linux user cannot access serial ports. > Maybe root connected a modem (can produce phone bills) or even > some serial card reader, maybe with the web servers key pair. > > I would expect that by default a user cannot open the serial port > because of insufficient permissions on the device file. I would > expect this on other unices as well (but I don't know it). > > For windows I think it should be similar but not impacting so > much in practice, because often windows users work with big > permissions on a somewhat high priviledge level or even > Administrator. > > > If we are to still respect lockfiles, we first need to > > Understand where we are expected to look for them. Does > > Anybody have any insight what variants of lockfile folder > > Schema exist out there in the wild? Some apps like minicom > > Seem to even allow users to manually specify a lockfile > > Folder of their choice. > > At least my (ancient) minicom does not allow the user to change > this option, it is displayed but read-only, but root is allowed > to change it. > > > Because of the difficulty finding the right lockfile folder, > > And because of the inherent risk of thinking that something > > Might be locked while it actually isn't, I'd suggest that > > RXTX should have a "soft-off" feature that allows disabling > > ALL Lockfile checks at runtime without recompiling the native > > Sharedlibs. > > sounds very reasonable, yes... > and as admin I would not wish that users could skip such > locking because they do things wrong by default ;) > > (in the end I guess that is related to the dilemma, that > hotplug/user-owned-periphery and multi-user systems simply > conflict) > > > Trent - I like your strategy outline, but I think that it > > Needs to be configurable by the client such that users and/or > > Customer Support can disable lockfiles / disable ioctl in > > Case they detect that they are runing on an OS / Kernal that > > Does not support one or the other. > > Yes, this would be good I guess... Applications could offer > configuration options to control that, maybe similarily as > minicom. > > BTW, man minicom tells: > > *B - Lock file location > On most systems This should be /usr/spool/uucp. > Linux systems use /var/lock. If this directory > does not exist, minicom will not attempt to use > lockfiles. > > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure > and expedient electronic transaction acceptance. Ingenico products leverage > proven technology, established standards and unparalleled ergonomics to > provide optimal reliability, versatility and usability. This comprehensive > range of products is complemented by a global array of services and > partnerships, enabling businesses in a number of vertical sectors to accept > transactions anywhere their business takes them. www.ingenico.com This > message may contain confidential and/or privileged information. If you are > not the addressee or authorized to receive this for the addressee, you must > not use, copy, disclose or take any action based on this message or any > information herein. If you have received this message in error, please > advise the sender immediately by reply e-mail and delete this message. > Thank you for your cooperation. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Wed Apr 30 19:30:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 30 Apr 2008 19:30:51 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804301028.09307.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> <200804301028.09307.scldad@sdc.com.au> Message-ID: Hi Stephen, I suspect ioctl/TIOCEXCL open/O_EXCL would do the job. Mac uses TIOCEXCL and it is POSIX. We use O_EXCL for lockfiles on Linux already. On Wed, 30 Apr 2008, Stephen Davies wrote: > I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is > the same. > > Any ideas as to how to handle this? > > Stephen > > > On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: >> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: >>> The biggest problem that I have seen with lockfiles on Linux >>> At least is, that it seems there is no standard with respect >>> To the folder in which they should be created. Also, many >>> Distributions seem to set up file system permissions in such >>> A way that writing to the lockfile folder is not allowed for >>> The normal user -- that's why we stopped using lockfiles >>> In our commercial product. >> >> It seems it depends on the expectations. I consider it as a >> feature that by default a linux user cannot access serial ports. >> Maybe root connected a modem (can produce phone bills) or even >> some serial card reader, maybe with the web servers key pair. >> >> I would expect that by default a user cannot open the serial port >> because of insufficient permissions on the device file. I would >> expect this on other unices as well (but I don't know it). >> >> For windows I think it should be similar but not impacting so >> much in practice, because often windows users work with big >> permissions on a somewhat high priviledge level or even >> Administrator. >> >>> If we are to still respect lockfiles, we first need to >>> Understand where we are expected to look for them. Does >>> Anybody have any insight what variants of lockfile folder >>> Schema exist out there in the wild? Some apps like minicom >>> Seem to even allow users to manually specify a lockfile >>> Folder of their choice. >> >> At least my (ancient) minicom does not allow the user to change >> this option, it is displayed but read-only, but root is allowed >> to change it. >> >>> Because of the difficulty finding the right lockfile folder, >>> And because of the inherent risk of thinking that something >>> Might be locked while it actually isn't, I'd suggest that >>> RXTX should have a "soft-off" feature that allows disabling >>> ALL Lockfile checks at runtime without recompiling the native >>> Sharedlibs. >> >> sounds very reasonable, yes... >> and as admin I would not wish that users could skip such >> locking because they do things wrong by default ;) >> >> (in the end I guess that is related to the dilemma, that >> hotplug/user-owned-periphery and multi-user systems simply >> conflict) >> >>> Trent - I like your strategy outline, but I think that it >>> Needs to be configurable by the client such that users and/or >>> Customer Support can disable lockfiles / disable ioctl in >>> Case they detect that they are runing on an OS / Kernal that >>> Does not support one or the other. >> >> Yes, this would be good I guess... Applications could offer >> configuration options to control that, maybe similarily as >> minicom. >> >> BTW, man minicom tells: >> >> *B - Lock file location >> On most systems This should be /usr/spool/uucp. >> Linux systems use /var/lock. If this directory >> does not exist, minicom will not attempt to use >> lockfiles. >> >> The statement `Linux systems use /var/lock' is interesting, does >> anyone know the source of this convention? >> >> oki, >> >> Steffen >> >> About Ingenico Throughout the world businesses rely on Ingenico for secure >> and expedient electronic transaction acceptance. Ingenico products leverage >> proven technology, established standards and unparalleled ergonomics to >> provide optimal reliability, versatility and usability. This comprehensive >> range of products is complemented by a global array of services and >> partnerships, enabling businesses in a number of vertical sectors to accept >> transactions anywhere their business takes them. www.ingenico.com This >> message may contain confidential and/or privileged information. If you are >> not the addressee or authorized to receive this for the addressee, you must >> not use, copy, disclose or take any action based on this message or any >> information herein. If you have received this message in error, please >> advise the sender immediately by reply e-mail and delete this message. >> Thank you for your cooperation. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0052.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0050.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0037.html From pboulton at pulsetracer.com Fri Apr 18 14:30:13 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Fri, 18 Apr 2008 13:30:13 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site Message-ID: <480904D5.1060307@pulsetracer.com> Hello, gentle serial porters. I have downloaded the zipped up binaries for use on Windows without Sun's CommAPI, but don't seem able to extract anything from the download. Go to main page, http://www.rxtx.org/ Click on Downloads I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) And I save it to disk. If I try and extract the files with WinZip, Winzip thinks the archive is corrupt. If I try using Windows Explorer, I am able to extract it into a single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than the original .zip. Any help would be much appreciated. Sincerely, Philip Boulton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080418/97d89793/attachment-0035.html From tjarvi at qbang.org Fri Apr 18 19:07:00 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 18 Apr 2008 19:07:00 -0600 (MDT) Subject: [Rxtx] Difficulty opening zip file at rxtx site In-Reply-To: <480904D5.1060307@pulsetracer.com> References: <480904D5.1060307@pulsetracer.com> Message-ID: On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org From pboulton at pulsetracer.com Sat Apr 19 12:46:26 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Sat, 19 Apr 2008 11:46:26 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site References: <480904D5.1060307@pulsetracer.com> Message-ID: <53DB7576450695419E09299104043761A78533@ZTGSERVER.ztg.local> I have been able to get my hands on the binaries, by going to the ftp directory /pub/rxtx at ftp.qbang.org,, and ftping the file rxtx-2.1-7-bins-r2.zip . This opens happily with Winzip, and extracts as the set of files that you describe below. I only experience the ill-formed archive problem by clicking the link on the rxtx.org Downloads page (http://rxtx.qbang.org/pub/rxtx/ rxtx-2.1-7-bins-r2.zip ). Not sure what to make of that. Philip Boulton ________________________________ From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Fri 4/18/2008 6:07 PM To: Philip Boulton Cc: rxtx at qbang.org Subject: Re: [Rxtx] Difficulty opening zip file at rxtx site On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080419/147923bb/attachment-0034.html From jlar310 at gmail.com Sat Apr 19 19:11:55 2008 From: jlar310 at gmail.com (Jeff Larsen) Date: Sat, 19 Apr 2008 20:11:55 -0500 Subject: [Rxtx] Moxa serial over Ethernet driver Message-ID: Hi all, I've been using javax.comm for years to communicate with a legacy radio data system. We want to migrate the java side of the system to a VMware Server virtual machine. We've had great success using Moxa DE-303 and 5610 serial over Ethernet appliances and virtual machines for running hylafax. The OS (Linux in this case) uses a kernel driver to communicate with the Moxa via a virtual serial port such as /dev/ttyr00. I want to do the same thing with javax.comm or gnu.io to connect to a virtual serial port. However I'm hitting road blocks everywhere. javax.comm for Linux sees the virtual port, but there are transmission errors. Tried Solaris too, but the Solaris Moxa drivers don't play nice with javax.comm because the driver uses /dev/pts/n instead of /dev/term/x. Next I tried RXTX on Linux, but I'm getting NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX on Solaris. Has anyone used RXTX with serial over Ethernet devices? Any hints on how to make it work? I know that I'm not completely off track because javax.comm does work with Moxa on a Windows platform, but that's just not an option for production deployment. -- Jeff From tjarvi at qbang.org Sat Apr 19 21:08:41 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 19 Apr 2008 21:08:41 -0600 (MDT) Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: yOn Sat, 19 Apr 2008, Jeff Larsen wrote: > Hi all, > > I've been using javax.comm for years to communicate with a legacy > radio data system. We want to migrate the java side of the system to a > VMware Server virtual machine. We've had great success using Moxa > DE-303 and 5610 serial over Ethernet appliances and virtual machines > for running hylafax. The OS (Linux in this case) uses a kernel driver > to communicate with the Moxa via a virtual serial port such as > /dev/ttyr00. > > I want to do the same thing with javax.comm or gnu.io to connect to a > virtual serial port. However I'm hitting road blocks everywhere. > javax.comm for Linux sees the virtual port, but there are transmission > errors. Tried Solaris too, but the Solaris Moxa drivers don't play > nice with javax.comm because the driver uses /dev/pts/n instead of > /dev/term/x. Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris. > > Has anyone used RXTX with serial over Ethernet devices? Any hints on > how to make it work? > > I know that I'm not completely off track because javax.comm does work > with Moxa on a Windows platform, but that's just not an option for > production deployment. > > Moxa should work under linux. There may be minor issues depending upon how complete the kernel driver is but I think it will work. One of the minor issues is /dev/ttyr00 is not enumerated. There are several work arounds documented with the source code and on the wiki. The easiest solution for testing purposes is to make a symbolic link from /dev/ttyr00 to a port that is enumerated such as /dev/ttyS129. You can later alter the rxtx source or use properties to change the enumerated ports. -- Trent Jarvi tjarvi at qbang.org From d.tonhofer at m-plify.com Sun Apr 20 03:33:30 2008 From: d.tonhofer at m-plify.com (David Tonhofer (M-PLIFY S.A.)) Date: Sun, 20 Apr 2008 11:33:30 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: <480B0DEA.5010908@m-plify.com> Jeff Larsen wrote: > Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris It might be that the Java side of RXTX does not recognize that portname. Trying modifying src/RXTXCommDriver.java as described in this case: http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card From ajmas at sympatico.ca Sun Apr 20 16:37:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Apr 2008 18:37:59 -0400 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <480B0DEA.5010908@m-plify.com> References: <480B0DEA.5010908@m-plify.com> Message-ID: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > Jeff Larsen wrote: >> Next I tried RXTX on Linux, but I'm getting >> NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX >> on Solaris > It might be that the Java side of RXTX does not recognize that > portname. > Trying modifying src/RXTXCommDriver.java as described in this case: > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card I wonder whether it would be worth allowing custom port prefixes as a system parameter? For example: gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" Andre From Martin.Oberhuber at windriver.com Tue Apr 22 12:34:36 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 22 Apr 2008 20:34:36 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> References: <480B0DEA.5010908@m-plify.com> <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE6485848056CD6CE@ism-mail03.corp.ad.wrs.com> Sounds like a great idea... I'm wondering how the "variable part" after the Prefixes could be specified though? What about allowing Regular Expression character Classes in the existing System Property for specifying ports: System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyS[0-9],ttyS[ABC],ttyUSB[0-9a-z]"); The set of allowed patterns would of course need to Be restricted compared to REGEX, because it must be A syntax that supports iterating over it. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Montag, 21. April 2008 00:38 > To: rxtx at qbang.org and Users > Subject: Re: [Rxtx] Moxa serial over Ethernet driver > > > On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > > Jeff Larsen wrote: > >> Next I tried RXTX on Linux, but I'm getting > >> NoSuchPortException connecting to /dev/ttyr00. I have yet > to try RXTX > >> on Solaris > > It might be that the Java side of RXTX does not recognize that > > portname. > > Trying modifying src/RXTXCommDriver.java as described in this case: > > > > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_ > SST-4P.2FLP_multiport_card > > I wonder whether it would be worth allowing custom port > prefixes as a > system parameter? For > example: > > gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Loi.TRAN at weatherford.com Tue Apr 22 13:10:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Tue, 22 Apr 2008 14:10:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled Message-ID: Hi, I'm currently using the Java RXTX API to interface to a serial port. The serial port is connected to a bridge board that communicates with our communications system running at 1.875 Mbps which is linked to an embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no flow control). I send a command to the embedded board through the serial-bridge board which then is relayed to the embedded board. The command sent asks the embedded board to dump a binary image. Here's where I'm hitting some problems. I've successfully done this is an integrated serial port from the laptop. The binary file that comes back is consistent on every attempt. When I use the application I've written to do the same thing with a USB-to-serial adapter, the image I get back is not the same as the image I receive through the USB-to-serial adapter is not consistent at all. A final thing is that when I use a terminal program to dump the binary image with the USB-serial adapter, the image is correct. Every time! What is the terminal program doing that's not being done in my application? My application is quite simple. Has anyone observed this behavior before? If you have, I'd like to know how you've gotten around this problem. Thanks, LT =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From tjarvi at qbang.org Tue Apr 22 21:11:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 22 Apr 2008 21:11:10 -0600 (MDT) Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org From Loi.TRAN at weatherford.com Wed Apr 23 08:35:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Wed, 23 Apr 2008 09:35:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: Thanks for all the responses. I finally tried something that worked consistently. I updated my Prolific driver and repeated my tests. It worked. If you're using the Prolific type USB-serial adapters, do no use the Prolific version 2.0.2.1 driver on Windows. Update it to the latest 2.0.2.8 version. Again, thanks for all the responses. LT -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Tuesday, April 22, 2008 10:11 PM To: TRAN, Loi X. Cc: rxtx at qbang.org Subject: Re: [Rxtx] Prolific USB - RXTX data mangled On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From Martin.Oberhuber at windriver.com Wed Apr 23 18:54:26 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 02:54:26 +0200 Subject: [Rxtx] RXTX port locking on Linux status? Message-ID: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Dear RXTX community, I'm wondering what the status is with RXTX locking serial ports on Linux? My understanding is that the mechanism used in 2.1-7r2 (lockfiles) is not really state of the art, and has lots of problems (e.g. missing permissions). There was an idea to migrate towards a Kernel syscall based solution for port locking. What's the status here? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/9878db9f/attachment-0030.html From tjarvi at qbang.org Wed Apr 23 20:32:24 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Apr 2008 20:32:24 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > Dear RXTX community, > > I'm wondering what the status is with RXTX locking > serial ports on Linux? > > My understanding is that the mechanism used in > 2.1-7r2 (lockfiles) is not really state of the art, and > has lots of problems (e.g. missing permissions). > > There was an idea to migrate towards a Kernel > syscall based solution for port locking. > > What's the status here? > Hi Martin, I'm in favor of deprecating the current FHS locking mechanism in favor of an IOCTL when available. I think it will be available on all the platforms but do not know for sure. The status is unchanged. I've had very few free cycles for such things. Feel free to take a stab at it if you have some time. I believe the IOCTL is used in the Mac OS X code already. I don't see any real backwards compatability issues and the IOCTL should just work. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Apr 24 06:14:06 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 14:14:06 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Thanks Trent. Problem is only that I'm really not at all Familiar with the C part of RXTX. If there Were anything I could do in Java for this, It would be easier for me.... ... Are there any C experts here on the list Who'd like to look at ioctl port locking For linux? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Donnerstag, 24. April 2008 04:32 > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > I'm wondering what the status is with RXTX locking > > serial ports on Linux? > > > > My understanding is that the mechanism used in > > 2.1-7r2 (lockfiles) is not really state of the art, and > > has lots of problems (e.g. missing permissions). > > > > There was an idea to migrate towards a Kernel > > syscall based solution for port locking. > > > > What's the status here? > > > > Hi Martin, > > I'm in favor of deprecating the current FHS locking mechanism > in favor of > an IOCTL when available. I think it will be available on all the > platforms but do not know for sure. > > The status is unchanged. I've had very few free cycles for > such things. > Feel free to take a stab at it if you have some time. I > believe the IOCTL > is used in the Mac OS X code already. > > I don't see any real backwards compatability issues and the > IOCTL should > just work. > > -- > Trent Jarvi > tjarvi at qbang.org > From sspies at sloc.de Thu Apr 24 07:15:36 2008 From: sspies at sloc.de (Sebastian Spies) Date: Thu, 24 Apr 2008 15:15:36 +0200 (CEST) Subject: [Rxtx] rxtx on gumstix: Interrupted system call In-Reply-To: <47FB7B20.7080504@sloc.de> References: <47FB7B20.7080504@sloc.de> Message-ID: <55445.130.83.139.205.1209042936.squirrel@ssl.sloc.de> Dear list, while porting rxtx to the gumstix, I found out, that select used in readArray in SerialImp.c might not work as expected. Maybe, because of missing TIOCSERGETLSR-support? select is often interrupted, so i wrote the following quick'n'dirty hack to make it work on gumstix: diff -Nur rxtx-2.1-7r2/src/SerialImp.c rxtx-2.1-7r2/src/SerialImp.c --- rxtx-2.1-7r2/src/SerialImp.c 2006-01-29 23:19:04.000000000 +0100 +++ rxtx-2.1-7r2-patched/src/SerialImp.c 2008-04-24 14:30:17.000000000 +0200 @@ -3380,7 +3381,7 @@ JNIEXPORT jint JNICALL RXTXPort(readArray)( JNIEnv *env, jobject jobj, jbyteArray jbarray, jint offset, jint length ) { - int bytes; + int bytes = 0; jbyte *body; /* char msg[80]; */ int fd = get_java_var( env, jobj, "fd", "I" ); @@ -3397,9 +3398,18 @@ "readArray", "Invalid length" ); return -1; } - body = (*env)->GetByteArrayElements( env, jbarray, 0 ); - bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ - (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + while(1 > bytes) + { + body = (*env)->GetByteArrayElements( env, jbarray, 0 ); + bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ + (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + // quick'n'dirty - SSP + report (" trying again... \n"); + errno = 0; + } + if( bytes < 0 ) { report( "RXTXPort:readArray bytes < 0" ); LEAVE( "RXTXPort:readArray" ); > Hey, > > I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use > RXTXPort$SerialInputStream.read(), then I get the following Exception. I > did not yet figure out which system call is interrupted as strace > produces loads of output. > > Any help would be very appreciated. Thanks in advance. > Sebastian > > > [java] java.io.IOException: Interrupted system call in readArray > [java] at gnu.io.RXTXPort.readArray(Native Method) > [java] at > gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) > [java] at > java.io.FilterInputStream.read(FilterInputStream.java:189) > [java] at > java.io.BufferedInputStream.refill(BufferedInputStream.java:371) > [java] at > java.io.BufferedInputStream.read(BufferedInputStream.java:229) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) > [java] at > com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) > > -- > Sebastian Spies > > mail: sspies at sloc.de > > > > From fire_baptized at hotmail.com Thu Apr 24 18:27:48 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Thu, 24 Apr 2008 20:27:48 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hello I am having a problem with the serial device connecting (software wise) to the serial port. However I have a test program and it seems to work just fine in that environment - and it doesnt use GUI. The error I am getting is : PortNotFoundException Now the way I have it setup in the GUI environment is that once the user pushes a JButton the program connects using this class: protected void establishConnection() { try { portId = CommPortIdentifier.getPortIdentifier("COM3"); System.out.println("Establishing connction....."); messages[0] = "\nEstablishing connction.....\n"; } catch ( NoSuchPortException noport) { System.out.println("Port not found: "+ noport); messages[0] = "Port not found: "+ noport+"\n"; } try { serialPort = (SerialPort) portId.open("serial", 50); System.out.println("Port has been found."); messages[1] = "Port has been found.\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[1] = "" +usedport; } try { serialPort = (SerialPort) portId.open("serial", 50); messages[2] = "Connecting to COM3 on port 50....\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; } try { serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); System.out.println("Esablishing the transfer rate settings for COM3."); messages[3] = "Esablishing the transfer rate settings for COM3.\n"; } catch (UnsupportedCommOperationException nosupcom) { System.out.println(nosupcom); System.out.println("The tranfer rate could not be esblished on COM3."); messages[3] = "The tranfer rate could not be esblished on COM3.\n"; } System.out.println(serialPort.getFlowControlMode()); messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; //sendDataOut(buffer[3],buffer[4]); } I need all the data in this method (and all the string values in this method) to be printed out on a JTextArea. I wont do me any good if not all the text is printed on a JTextArea in another class. So I have the text printing the JTextArea correctly, but everytime the JButton is activated - it gives me that error message. I did add a disconnect button that is supposed to call the serialPort.close(). _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/273fd4ec/attachment-0029.html From tjarvi at qbang.org Thu Apr 24 21:54:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Apr 2008 21:54:10 -0600 (MDT) Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > Hello I am having a problem with the serial device connecting (software > wise) to the serial port. However I have a test program and it seems to > work just fine in that environment - and it doesnt use GUI. The error I > am getting is : PortNotFoundException Now the way I have it setup in the > GUI environment is that once the user pushes a JButton the program > connects using this class: > > protected void establishConnection() { > try { > portId = CommPortIdentifier.getPortIdentifier("COM3"); > System.out.println("Establishing connction....."); > messages[0] = "\nEstablishing connction.....\n"; > } > catch ( NoSuchPortException noport) { > System.out.println("Port not found: "+ noport); > messages[0] = "Port not found: "+ noport+"\n"; > } > try { > serialPort = (SerialPort) portId.open("serial", 50); > System.out.println("Port has been found."); > messages[1] = "Port has been found.\n"; > } > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[1] = "" +usedport; > } ================================================================= > try { > serialPort = (SerialPort) portId.open("serial", 50); > messages[2] = "Connecting to COM3 on port 50....\n"; > } ================================================================== > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > } > try { > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > System.out.println("Esablishing the transfer rate settings for COM3."); > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > } > catch (UnsupportedCommOperationException nosupcom) { > System.out.println(nosupcom); > System.out.println("The tranfer rate could not be esblished on COM3."); > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > } > System.out.println(serialPort.getFlowControlMode()); > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > //sendDataOut(buffer[3],buffer[4]); > } > > I need all the data in this method (and all the string values in this > method) to be printed out on a JTextArea. I wont do me any good if not > all the text is printed on a JTextArea in another class. So I have the > text printing the JTextArea correctly, but everytime the JButton is > activated - it gives me that error message. I did add a disconnect > button that is supposed to call the serialPort.close(). > The open code used twice is going to throw an exception. It may be that you catch the exception above this code and print a confusing message? A common mistake is people will accidently run two copies of their program. The first instance of the program will open the port and prevent enumeration (finding the port) in the second instance of the program. As an example, you may be running your text based application which is preventing the GUI from seeing the port. Enumeration is done by trying to open the port. If the port is open, Enumeration fails. -- Trent Jarvi tjarvi at qbang.org From fire_baptized at hotmail.com Thu Apr 24 22:32:05 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 00:32:05 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Wow - thanks dude what a dumb thing for me to not catch..... now here is the current problem - right now I am trying to output data again one is with the test program - and it seems that serialPort.setRTS(true); is throwing an exceptions there - now if I show this code please bare in mind that I am only testing - the code is kinda sloppy in my mind - but if I can figure out why calling this function is throwing an exception then maybe I can figure out why my GUI application is getting the same null pointer exceptions when try to send out the data stream. FYI Trent this email is not directed towards you - anyone can jump in on this public static void main(String args[]) { byte[] b = new byte[64]; int keyinput = 0 ; byte x = 0; byte y = 0; PortTesting1 testports = new PortTesting1(); try { joyskoro = Joystick.createInstance(); } catch (IOException ioexc) { System.out.println("There is an input/output problem: " + ioexc); } while (true) { joyskoro.poll(); b[0] = ((byte) -(10 * joyskoro.getY())); b[1] = ((byte) (10 * joyskoro.getX())); System.out.println("The 3rd byte is: " +b[0]); System.out.println("The 4rd byte is: " +b[1]); serialPort.setRTS(true); // HERE IS WHERE THE PROBLEM IS !!!!!!! ON THIS LINE but if I dont have it active in my program the Bluetooth device (that is System.out.println("Ready to send :-) !"); //connected to the serial port does not send out data!!!!! if (joyskoro.isButtonDown(joyskoro.BUTTON10)) { System.out.println("Connection terminated."); serialPort.close(); break; } if (joyskoro.isButtonDown(joyskoro.BUTTON2)) { boolean flag = true; //reading from key input from the keyboard System.out.println("Please input a command: "); while (flag) { try { keyinput = System.in.read(); } catch (IOException ioexc) {/*there is no need to put * anything here */ } if((char)keyinput=='w') { pushIt((byte)85); } if((char)keyinput=='s') { pushIt((byte)84); } if((char)keyinput=='a') { pushIt((byte)83); } if((char)keyinput=='d') { pushIt((byte)82); } if((char)keyinput=='q') { pushIt((byte)89); } if((char)keyinput=='\t') { //this stop reading input from the keyboard flag = false; } } and help anyways here is the block of code that throwing an exception for the test program: > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/5c8f7d68/attachment-0029.html From fire_baptized at hotmail.com Fri Apr 25 07:59:53 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 09:59:53 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Are there any examples of how to push out data? As in using input and output streams - if I can compare code maybe I can see where this is causing a problem. I have a byte array that I am pushing out data. I keep getting null pointer exceptions every where I turn. > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/22228ab6/attachment-0028.html From ajmas at sympatico.ca Sat Apr 26 07:37:09 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 26 Apr 2008 09:37:09 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hi, On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote: > > Are there any examples of how to push out data? As in using input > and output streams - if I can compare code maybe I can see where > this is causing a problem. I have a byte array that I am pushing > out data. I keep getting null pointer exceptions every where I turn. > There are some examples here that might be of help: http://rxtx.qbang.org/wiki/index.php/Examples Andre From fire_baptized at hotmail.com Sat Apr 26 20:13:54 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Sat, 26 Apr 2008 22:13:54 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: looked at those....yep didnt help - I need to push out data with GUI and not get a null pointer exception everytime I try. > CC: rxtx at qbang.org> From: ajmas at sympatico.ca> To: fire_baptized at hotmail.com> Subject: Re: [Rxtx] Serial Problems with Gui.....> Date: Sat, 26 Apr 2008 09:37:09 -0400> > Hi,> > > On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote:> >> > Are there any examples of how to push out data? As in using input > > and output streams - if I can compare code maybe I can see where > > this is causing a problem. I have a byte array that I am pushing > > out data. I keep getting null pointer exceptions every where I turn.> >> > There are some examples here that might be of help:> > http://rxtx.qbang.org/wiki/index.php/Examples> > Andre _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080426/09f95b41/attachment-0027.html From michael.erskine at ketech.com Mon Apr 28 02:47:22 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 28 Apr 2008 09:47:22 +0100 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D426EF3CBBC5@no-sv-03.ketech.local> Jesrael D. Summerhill wrote: > looked at those....yep didnt help - I need to push out data with GUI and > not get a null pointer exception everytime I try. So it seems pretty obvious that your code needs to check for nulls wherever one may occur and report what's happening. Alternatively, catch the npe and display the stack trace. Then you can fix your code so it doesn't try to work with something that ain't there. Regards, Michael Erskine. From scldad at sdc.com.au Mon Apr 28 03:58:34 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Mon, 28 Apr 2008 19:28:34 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Message-ID: <200804281928.34454.scldad@sdc.com.au> Has anybody done any design work on this? The first thing that springs to mind is that we still need to check for lock files because other apps tend to use that approach even if we go to ioctl. Cheers, Stephen Davies On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > Thanks Trent. > > Problem is only that I'm really not at all > Familiar with the C part of RXTX. If there > Were anything I could do in Java for this, > It would be easier for me.... > > ... Are there any C experts here on the list > Who'd like to look at ioctl port locking > For linux? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > -----Original Message----- > > From: Trent Jarvi [mailto:tjarvi at qbang.org] > > Sent: Donnerstag, 24. April 2008 04:32 > > To: Oberhuber, Martin > > Cc: rxtx at qbang.org > > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > > > I'm wondering what the status is with RXTX locking > > > serial ports on Linux? > > > > > > My understanding is that the mechanism used in > > > 2.1-7r2 (lockfiles) is not really state of the art, and > > > has lots of problems (e.g. missing permissions). > > > > > > There was an idea to migrate towards a Kernel > > > syscall based solution for port locking. > > > > > > What's the status here? > > > > Hi Martin, > > > > I'm in favor of deprecating the current FHS locking mechanism > > in favor of > > an IOCTL when available. I think it will be available on all the > > platforms but do not know for sure. > > > > The status is unchanged. I've had very few free cycles for > > such things. > > Feel free to take a stab at it if you have some time. I > > believe the IOCTL > > is used in the Mac OS X code already. > > > > I don't see any real backwards compatability issues and the > > IOCTL should > > just work. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Mon Apr 28 04:21:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 28 Apr 2008 04:21:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804281928.34454.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: I don't think there would need to be any architectural changes. A couple ifdefs and minor changes in the current code should be enough. Proposal: FHS/UUCP locks: continue to respect them, try to create them but do not error if the IOCTL is supported. (But does the IOCTL being defined mean it will work?) Enumeration: Do not assert the IOCTL while opening. Serial.open: assert the IOCTL after open. Continue to use locks as described above after asserting the IOCTL. If the IOCTL is defined but not working, handle it here. Failure cases include the IOCTL is not supported and the port is already locked. On Mon, 28 Apr 2008, Stephen Davies wrote: > Has anybody done any design work on this? > The first thing that springs to mind is that we still need to check for lock > files because other apps tend to use that approach even if we go to ioctl. > > Cheers, > Stephen Davies > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: >> Thanks Trent. >> >> Problem is only that I'm really not at all >> Familiar with the C part of RXTX. If there >> Were anything I could do in Java for this, >> It would be easier for me.... >> >> ... Are there any C experts here on the list >> Who'd like to look at ioctl port locking >> For linux? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >>> -----Original Message----- >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] >>> Sent: Donnerstag, 24. April 2008 04:32 >>> To: Oberhuber, Martin >>> Cc: rxtx at qbang.org >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? >>> >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: >>>> Dear RXTX community, >>>> >>>> I'm wondering what the status is with RXTX locking >>>> serial ports on Linux? >>>> >>>> My understanding is that the mechanism used in >>>> 2.1-7r2 (lockfiles) is not really state of the art, and >>>> has lots of problems (e.g. missing permissions). >>>> >>>> There was an idea to migrate towards a Kernel >>>> syscall based solution for port locking. >>>> >>>> What's the status here? >>> >>> Hi Martin, >>> >>> I'm in favor of deprecating the current FHS locking mechanism >>> in favor of >>> an IOCTL when available. I think it will be available on all the >>> platforms but do not know for sure. >>> >>> The status is unchanged. I've had very few free cycles for >>> such things. >>> Feel free to take a stab at it if you have some time. I >>> believe the IOCTL >>> is used in the Mac OS X code already. >>> >>> I don't see any real backwards compatability issues and the >>> IOCTL should >>> just work. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Tue Apr 29 12:04:04 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Apr 2008 20:04:04 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Hi all, The biggest problem that I have seen with lockfiles on Linux At least is, that it seems there is no standard with respect To the folder in which they should be created. Also, many Distributions seem to set up file system permissions in such A way that writing to the lockfile folder is not allowed for The normal user -- that's why we stopped using lockfiles In our commercial product. If we are to still respect lockfiles, we first need to Understand where we are expected to look for them. Does Anybody have any insight what variants of lockfile folder Schema exist out there in the wild? Some apps like minicom Seem to even allow users to manually specify a lockfile Folder of their choice. Because of the difficulty finding the right lockfile folder, And because of the inherent risk of thinking that something Might be locked while it actually isn't, I'd suggest that RXTX should have a "soft-off" feature that allows disabling ALL Lockfile checks at runtime without recompiling the native Sharedlibs. Trent - I like your strategy outline, but I think that it Needs to be configurable by the client such that users and/or Customer Support can disable lockfiles / disable ioctl in Case they detect that they are runing on an OS / Kernal that Does not support one or the other. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Montag, 28. April 2008 12:22 > To: Stephen Davies > Cc: rxtx at qbang.org; Oberhuber, Martin; Trent Jarvi > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > I don't think there would need to be any architectural > changes. A couple > ifdefs and minor changes in the current code should be enough. > > Proposal: > > FHS/UUCP locks: > continue to respect them, try to create them but do not error if > the IOCTL is supported. (But does the IOCTL being defined mean > it will work?) > Enumeration: > Do not assert the IOCTL while opening. > Serial.open: > assert the IOCTL after open. Continue to use locks as described > above after asserting the IOCTL. If the IOCTL is defined but > not working, handle it here. Failure cases include the IOCTL > is not supported and the port is already locked. > > On Mon, 28 Apr 2008, Stephen Davies wrote: > > > Has anybody done any design work on this? > > The first thing that springs to mind is that we still need > to check for lock > > files because other apps tend to use that approach even if > we go to ioctl. > > > > Cheers, > > Stephen Davies > > > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > >> Thanks Trent. > >> > >> Problem is only that I'm really not at all > >> Familiar with the C part of RXTX. If there > >> Were anything I could do in Java for this, > >> It would be easier for me.... > >> > >> ... Are there any C experts here on the list > >> Who'd like to look at ioctl port locking > >> For linux? > >> > >> Thanks, > >> -- > >> Martin Oberhuber, Senior Member of Technical Staff, Wind River > >> Target Management Project Lead, DSDP PMC Member > >> http://www.eclipse.org/dsdp/tm > >> > >>> -----Original Message----- > >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] > >>> Sent: Donnerstag, 24. April 2008 04:32 > >>> To: Oberhuber, Martin > >>> Cc: rxtx at qbang.org > >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? > >>> > >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > >>>> Dear RXTX community, > >>>> > >>>> I'm wondering what the status is with RXTX locking > >>>> serial ports on Linux? > >>>> > >>>> My understanding is that the mechanism used in > >>>> 2.1-7r2 (lockfiles) is not really state of the art, and > >>>> has lots of problems (e.g. missing permissions). > >>>> > >>>> There was an idea to migrate towards a Kernel > >>>> syscall based solution for port locking. > >>>> > >>>> What's the status here? > >>> > >>> Hi Martin, > >>> > >>> I'm in favor of deprecating the current FHS locking mechanism > >>> in favor of > >>> an IOCTL when available. I think it will be available on all the > >>> platforms but do not know for sure. > >>> > >>> The status is unchanged. I've had very few free cycles for > >>> such things. > >>> Feel free to take a stab at it if you have some time. I > >>> believe the IOCTL > >>> is used in the Mac OS X code already. > >>> > >>> I don't see any real backwards compatability issues and the > >>> IOCTL should > >>> just work. > >>> > >>> -- > >>> Trent Jarvi > >>> tjarvi at qbang.org > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > From Steffen.DETTMER at ingenico.com Tue Apr 29 13:34:44 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 29 Apr 2008 21:34:44 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Message-ID: <20080429193444.GU2928@elberon.bln.de.ingenico.com> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > The biggest problem that I have seen with lockfiles on Linux > At least is, that it seems there is no standard with respect > To the folder in which they should be created. Also, many > Distributions seem to set up file system permissions in such > A way that writing to the lockfile folder is not allowed for > The normal user -- that's why we stopped using lockfiles > In our commercial product. It seems it depends on the expectations. I consider it as a feature that by default a linux user cannot access serial ports. Maybe root connected a modem (can produce phone bills) or even some serial card reader, maybe with the web servers key pair. I would expect that by default a user cannot open the serial port because of insufficient permissions on the device file. I would expect this on other unices as well (but I don't know it). For windows I think it should be similar but not impacting so much in practice, because often windows users work with big permissions on a somewhat high priviledge level or even Administrator. > If we are to still respect lockfiles, we first need to > Understand where we are expected to look for them. Does > Anybody have any insight what variants of lockfile folder > Schema exist out there in the wild? Some apps like minicom > Seem to even allow users to manually specify a lockfile > Folder of their choice. At least my (ancient) minicom does not allow the user to change this option, it is displayed but read-only, but root is allowed to change it. > Because of the difficulty finding the right lockfile folder, > And because of the inherent risk of thinking that something > Might be locked while it actually isn't, I'd suggest that > RXTX should have a "soft-off" feature that allows disabling > ALL Lockfile checks at runtime without recompiling the native > Sharedlibs. sounds very reasonable, yes... and as admin I would not wish that users could skip such locking because they do things wrong by default ;) (in the end I guess that is related to the dilemma, that hotplug/user-owned-periphery and multi-user systems simply conflict) > Trent - I like your strategy outline, but I think that it > Needs to be configurable by the client such that users and/or > Customer Support can disable lockfiles / disable ioctl in > Case they detect that they are runing on an OS / Kernal that > Does not support one or the other. Yes, this would be good I guess... Applications could offer configuration options to control that, maybe similarily as minicom. BTW, man minicom tells: *B - Lock file location On most systems This should be /usr/spool/uucp. Linux systems use /var/lock. If this directory does not exist, minicom will not attempt to use lockfiles. The statement `Linux systems use /var/lock' is interesting, does anyone know the source of this convention? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Tue Apr 29 16:11:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Apr 2008 16:11:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? These details are outlined in the Filesystem Hierarchy Standard (FHS). http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLOCKLOCKFILES -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Tue Apr 29 18:58:09 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Wed, 30 Apr 2008 10:28:09 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: <200804301028.09307.scldad@sdc.com.au> I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is the same. Any ideas as to how to handle this? Stephen On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: > * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > > The biggest problem that I have seen with lockfiles on Linux > > At least is, that it seems there is no standard with respect > > To the folder in which they should be created. Also, many > > Distributions seem to set up file system permissions in such > > A way that writing to the lockfile folder is not allowed for > > The normal user -- that's why we stopped using lockfiles > > In our commercial product. > > It seems it depends on the expectations. I consider it as a > feature that by default a linux user cannot access serial ports. > Maybe root connected a modem (can produce phone bills) or even > some serial card reader, maybe with the web servers key pair. > > I would expect that by default a user cannot open the serial port > because of insufficient permissions on the device file. I would > expect this on other unices as well (but I don't know it). > > For windows I think it should be similar but not impacting so > much in practice, because often windows users work with big > permissions on a somewhat high priviledge level or even > Administrator. > > > If we are to still respect lockfiles, we first need to > > Understand where we are expected to look for them. Does > > Anybody have any insight what variants of lockfile folder > > Schema exist out there in the wild? Some apps like minicom > > Seem to even allow users to manually specify a lockfile > > Folder of their choice. > > At least my (ancient) minicom does not allow the user to change > this option, it is displayed but read-only, but root is allowed > to change it. > > > Because of the difficulty finding the right lockfile folder, > > And because of the inherent risk of thinking that something > > Might be locked while it actually isn't, I'd suggest that > > RXTX should have a "soft-off" feature that allows disabling > > ALL Lockfile checks at runtime without recompiling the native > > Sharedlibs. > > sounds very reasonable, yes... > and as admin I would not wish that users could skip such > locking because they do things wrong by default ;) > > (in the end I guess that is related to the dilemma, that > hotplug/user-owned-periphery and multi-user systems simply > conflict) > > > Trent - I like your strategy outline, but I think that it > > Needs to be configurable by the client such that users and/or > > Customer Support can disable lockfiles / disable ioctl in > > Case they detect that they are runing on an OS / Kernal that > > Does not support one or the other. > > Yes, this would be good I guess... Applications could offer > configuration options to control that, maybe similarily as > minicom. > > BTW, man minicom tells: > > *B - Lock file location > On most systems This should be /usr/spool/uucp. > Linux systems use /var/lock. If this directory > does not exist, minicom will not attempt to use > lockfiles. > > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure > and expedient electronic transaction acceptance. Ingenico products leverage > proven technology, established standards and unparalleled ergonomics to > provide optimal reliability, versatility and usability. This comprehensive > range of products is complemented by a global array of services and > partnerships, enabling businesses in a number of vertical sectors to accept > transactions anywhere their business takes them. www.ingenico.com This > message may contain confidential and/or privileged information. If you are > not the addressee or authorized to receive this for the addressee, you must > not use, copy, disclose or take any action based on this message or any > information herein. If you have received this message in error, please > advise the sender immediately by reply e-mail and delete this message. > Thank you for your cooperation. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Wed Apr 30 19:30:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 30 Apr 2008 19:30:51 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804301028.09307.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> <200804301028.09307.scldad@sdc.com.au> Message-ID: Hi Stephen, I suspect ioctl/TIOCEXCL open/O_EXCL would do the job. Mac uses TIOCEXCL and it is POSIX. We use O_EXCL for lockfiles on Linux already. On Wed, 30 Apr 2008, Stephen Davies wrote: > I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is > the same. > > Any ideas as to how to handle this? > > Stephen > > > On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: >> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: >>> The biggest problem that I have seen with lockfiles on Linux >>> At least is, that it seems there is no standard with respect >>> To the folder in which they should be created. Also, many >>> Distributions seem to set up file system permissions in such >>> A way that writing to the lockfile folder is not allowed for >>> The normal user -- that's why we stopped using lockfiles >>> In our commercial product. >> >> It seems it depends on the expectations. I consider it as a >> feature that by default a linux user cannot access serial ports. >> Maybe root connected a modem (can produce phone bills) or even >> some serial card reader, maybe with the web servers key pair. >> >> I would expect that by default a user cannot open the serial port >> because of insufficient permissions on the device file. I would >> expect this on other unices as well (but I don't know it). >> >> For windows I think it should be similar but not impacting so >> much in practice, because often windows users work with big >> permissions on a somewhat high priviledge level or even >> Administrator. >> >>> If we are to still respect lockfiles, we first need to >>> Understand where we are expected to look for them. Does >>> Anybody have any insight what variants of lockfile folder >>> Schema exist out there in the wild? Some apps like minicom >>> Seem to even allow users to manually specify a lockfile >>> Folder of their choice. >> >> At least my (ancient) minicom does not allow the user to change >> this option, it is displayed but read-only, but root is allowed >> to change it. >> >>> Because of the difficulty finding the right lockfile folder, >>> And because of the inherent risk of thinking that something >>> Might be locked while it actually isn't, I'd suggest that >>> RXTX should have a "soft-off" feature that allows disabling >>> ALL Lockfile checks at runtime without recompiling the native >>> Sharedlibs. >> >> sounds very reasonable, yes... >> and as admin I would not wish that users could skip such >> locking because they do things wrong by default ;) >> >> (in the end I guess that is related to the dilemma, that >> hotplug/user-owned-periphery and multi-user systems simply >> conflict) >> >>> Trent - I like your strategy outline, but I think that it >>> Needs to be configurable by the client such that users and/or >>> Customer Support can disable lockfiles / disable ioctl in >>> Case they detect that they are runing on an OS / Kernal that >>> Does not support one or the other. >> >> Yes, this would be good I guess... Applications could offer >> configuration options to control that, maybe similarily as >> minicom. >> >> BTW, man minicom tells: >> >> *B - Lock file location >> On most systems This should be /usr/spool/uucp. >> Linux systems use /var/lock. If this directory >> does not exist, minicom will not attempt to use >> lockfiles. >> >> The statement `Linux systems use /var/lock' is interesting, does >> anyone know the source of this convention? >> >> oki, >> >> Steffen >> >> About Ingenico Throughout the world businesses rely on Ingenico for secure >> and expedient electronic transaction acceptance. Ingenico products leverage >> proven technology, established standards and unparalleled ergonomics to >> provide optimal reliability, versatility and usability. This comprehensive >> range of products is complemented by a global array of services and >> partnerships, enabling businesses in a number of vertical sectors to accept >> transactions anywhere their business takes them. www.ingenico.com This >> message may contain confidential and/or privileged information. If you are >> not the addressee or authorized to receive this for the addressee, you must >> not use, copy, disclose or take any action based on this message or any >> information herein. If you have received this message in error, please >> advise the sender immediately by reply e-mail and delete this message. >> Thank you for your cooperation. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0053.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0051.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0038.html From pboulton at pulsetracer.com Fri Apr 18 14:30:13 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Fri, 18 Apr 2008 13:30:13 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site Message-ID: <480904D5.1060307@pulsetracer.com> Hello, gentle serial porters. I have downloaded the zipped up binaries for use on Windows without Sun's CommAPI, but don't seem able to extract anything from the download. Go to main page, http://www.rxtx.org/ Click on Downloads I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) And I save it to disk. If I try and extract the files with WinZip, Winzip thinks the archive is corrupt. If I try using Windows Explorer, I am able to extract it into a single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than the original .zip. Any help would be much appreciated. Sincerely, Philip Boulton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080418/97d89793/attachment-0036.html From tjarvi at qbang.org Fri Apr 18 19:07:00 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 18 Apr 2008 19:07:00 -0600 (MDT) Subject: [Rxtx] Difficulty opening zip file at rxtx site In-Reply-To: <480904D5.1060307@pulsetracer.com> References: <480904D5.1060307@pulsetracer.com> Message-ID: On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org From pboulton at pulsetracer.com Sat Apr 19 12:46:26 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Sat, 19 Apr 2008 11:46:26 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site References: <480904D5.1060307@pulsetracer.com> Message-ID: <53DB7576450695419E09299104043761A78533@ZTGSERVER.ztg.local> I have been able to get my hands on the binaries, by going to the ftp directory /pub/rxtx at ftp.qbang.org,, and ftping the file rxtx-2.1-7-bins-r2.zip . This opens happily with Winzip, and extracts as the set of files that you describe below. I only experience the ill-formed archive problem by clicking the link on the rxtx.org Downloads page (http://rxtx.qbang.org/pub/rxtx/ rxtx-2.1-7-bins-r2.zip ). Not sure what to make of that. Philip Boulton ________________________________ From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Fri 4/18/2008 6:07 PM To: Philip Boulton Cc: rxtx at qbang.org Subject: Re: [Rxtx] Difficulty opening zip file at rxtx site On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080419/147923bb/attachment-0035.html From jlar310 at gmail.com Sat Apr 19 19:11:55 2008 From: jlar310 at gmail.com (Jeff Larsen) Date: Sat, 19 Apr 2008 20:11:55 -0500 Subject: [Rxtx] Moxa serial over Ethernet driver Message-ID: Hi all, I've been using javax.comm for years to communicate with a legacy radio data system. We want to migrate the java side of the system to a VMware Server virtual machine. We've had great success using Moxa DE-303 and 5610 serial over Ethernet appliances and virtual machines for running hylafax. The OS (Linux in this case) uses a kernel driver to communicate with the Moxa via a virtual serial port such as /dev/ttyr00. I want to do the same thing with javax.comm or gnu.io to connect to a virtual serial port. However I'm hitting road blocks everywhere. javax.comm for Linux sees the virtual port, but there are transmission errors. Tried Solaris too, but the Solaris Moxa drivers don't play nice with javax.comm because the driver uses /dev/pts/n instead of /dev/term/x. Next I tried RXTX on Linux, but I'm getting NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX on Solaris. Has anyone used RXTX with serial over Ethernet devices? Any hints on how to make it work? I know that I'm not completely off track because javax.comm does work with Moxa on a Windows platform, but that's just not an option for production deployment. -- Jeff From tjarvi at qbang.org Sat Apr 19 21:08:41 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 19 Apr 2008 21:08:41 -0600 (MDT) Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: yOn Sat, 19 Apr 2008, Jeff Larsen wrote: > Hi all, > > I've been using javax.comm for years to communicate with a legacy > radio data system. We want to migrate the java side of the system to a > VMware Server virtual machine. We've had great success using Moxa > DE-303 and 5610 serial over Ethernet appliances and virtual machines > for running hylafax. The OS (Linux in this case) uses a kernel driver > to communicate with the Moxa via a virtual serial port such as > /dev/ttyr00. > > I want to do the same thing with javax.comm or gnu.io to connect to a > virtual serial port. However I'm hitting road blocks everywhere. > javax.comm for Linux sees the virtual port, but there are transmission > errors. Tried Solaris too, but the Solaris Moxa drivers don't play > nice with javax.comm because the driver uses /dev/pts/n instead of > /dev/term/x. Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris. > > Has anyone used RXTX with serial over Ethernet devices? Any hints on > how to make it work? > > I know that I'm not completely off track because javax.comm does work > with Moxa on a Windows platform, but that's just not an option for > production deployment. > > Moxa should work under linux. There may be minor issues depending upon how complete the kernel driver is but I think it will work. One of the minor issues is /dev/ttyr00 is not enumerated. There are several work arounds documented with the source code and on the wiki. The easiest solution for testing purposes is to make a symbolic link from /dev/ttyr00 to a port that is enumerated such as /dev/ttyS129. You can later alter the rxtx source or use properties to change the enumerated ports. -- Trent Jarvi tjarvi at qbang.org From d.tonhofer at m-plify.com Sun Apr 20 03:33:30 2008 From: d.tonhofer at m-plify.com (David Tonhofer (M-PLIFY S.A.)) Date: Sun, 20 Apr 2008 11:33:30 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: <480B0DEA.5010908@m-plify.com> Jeff Larsen wrote: > Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris It might be that the Java side of RXTX does not recognize that portname. Trying modifying src/RXTXCommDriver.java as described in this case: http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card From ajmas at sympatico.ca Sun Apr 20 16:37:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Apr 2008 18:37:59 -0400 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <480B0DEA.5010908@m-plify.com> References: <480B0DEA.5010908@m-plify.com> Message-ID: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > Jeff Larsen wrote: >> Next I tried RXTX on Linux, but I'm getting >> NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX >> on Solaris > It might be that the Java side of RXTX does not recognize that > portname. > Trying modifying src/RXTXCommDriver.java as described in this case: > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card I wonder whether it would be worth allowing custom port prefixes as a system parameter? For example: gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" Andre From Martin.Oberhuber at windriver.com Tue Apr 22 12:34:36 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 22 Apr 2008 20:34:36 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> References: <480B0DEA.5010908@m-plify.com> <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE6485848056CD6CE@ism-mail03.corp.ad.wrs.com> Sounds like a great idea... I'm wondering how the "variable part" after the Prefixes could be specified though? What about allowing Regular Expression character Classes in the existing System Property for specifying ports: System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyS[0-9],ttyS[ABC],ttyUSB[0-9a-z]"); The set of allowed patterns would of course need to Be restricted compared to REGEX, because it must be A syntax that supports iterating over it. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Montag, 21. April 2008 00:38 > To: rxtx at qbang.org and Users > Subject: Re: [Rxtx] Moxa serial over Ethernet driver > > > On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > > Jeff Larsen wrote: > >> Next I tried RXTX on Linux, but I'm getting > >> NoSuchPortException connecting to /dev/ttyr00. I have yet > to try RXTX > >> on Solaris > > It might be that the Java side of RXTX does not recognize that > > portname. > > Trying modifying src/RXTXCommDriver.java as described in this case: > > > > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_ > SST-4P.2FLP_multiport_card > > I wonder whether it would be worth allowing custom port > prefixes as a > system parameter? For > example: > > gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Loi.TRAN at weatherford.com Tue Apr 22 13:10:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Tue, 22 Apr 2008 14:10:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled Message-ID: Hi, I'm currently using the Java RXTX API to interface to a serial port. The serial port is connected to a bridge board that communicates with our communications system running at 1.875 Mbps which is linked to an embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no flow control). I send a command to the embedded board through the serial-bridge board which then is relayed to the embedded board. The command sent asks the embedded board to dump a binary image. Here's where I'm hitting some problems. I've successfully done this is an integrated serial port from the laptop. The binary file that comes back is consistent on every attempt. When I use the application I've written to do the same thing with a USB-to-serial adapter, the image I get back is not the same as the image I receive through the USB-to-serial adapter is not consistent at all. A final thing is that when I use a terminal program to dump the binary image with the USB-serial adapter, the image is correct. Every time! What is the terminal program doing that's not being done in my application? My application is quite simple. Has anyone observed this behavior before? If you have, I'd like to know how you've gotten around this problem. Thanks, LT =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From tjarvi at qbang.org Tue Apr 22 21:11:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 22 Apr 2008 21:11:10 -0600 (MDT) Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org From Loi.TRAN at weatherford.com Wed Apr 23 08:35:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Wed, 23 Apr 2008 09:35:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: Thanks for all the responses. I finally tried something that worked consistently. I updated my Prolific driver and repeated my tests. It worked. If you're using the Prolific type USB-serial adapters, do no use the Prolific version 2.0.2.1 driver on Windows. Update it to the latest 2.0.2.8 version. Again, thanks for all the responses. LT -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Tuesday, April 22, 2008 10:11 PM To: TRAN, Loi X. Cc: rxtx at qbang.org Subject: Re: [Rxtx] Prolific USB - RXTX data mangled On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From Martin.Oberhuber at windriver.com Wed Apr 23 18:54:26 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 02:54:26 +0200 Subject: [Rxtx] RXTX port locking on Linux status? Message-ID: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Dear RXTX community, I'm wondering what the status is with RXTX locking serial ports on Linux? My understanding is that the mechanism used in 2.1-7r2 (lockfiles) is not really state of the art, and has lots of problems (e.g. missing permissions). There was an idea to migrate towards a Kernel syscall based solution for port locking. What's the status here? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/9878db9f/attachment-0031.html From tjarvi at qbang.org Wed Apr 23 20:32:24 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Apr 2008 20:32:24 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > Dear RXTX community, > > I'm wondering what the status is with RXTX locking > serial ports on Linux? > > My understanding is that the mechanism used in > 2.1-7r2 (lockfiles) is not really state of the art, and > has lots of problems (e.g. missing permissions). > > There was an idea to migrate towards a Kernel > syscall based solution for port locking. > > What's the status here? > Hi Martin, I'm in favor of deprecating the current FHS locking mechanism in favor of an IOCTL when available. I think it will be available on all the platforms but do not know for sure. The status is unchanged. I've had very few free cycles for such things. Feel free to take a stab at it if you have some time. I believe the IOCTL is used in the Mac OS X code already. I don't see any real backwards compatability issues and the IOCTL should just work. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Apr 24 06:14:06 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 14:14:06 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Thanks Trent. Problem is only that I'm really not at all Familiar with the C part of RXTX. If there Were anything I could do in Java for this, It would be easier for me.... ... Are there any C experts here on the list Who'd like to look at ioctl port locking For linux? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Donnerstag, 24. April 2008 04:32 > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > I'm wondering what the status is with RXTX locking > > serial ports on Linux? > > > > My understanding is that the mechanism used in > > 2.1-7r2 (lockfiles) is not really state of the art, and > > has lots of problems (e.g. missing permissions). > > > > There was an idea to migrate towards a Kernel > > syscall based solution for port locking. > > > > What's the status here? > > > > Hi Martin, > > I'm in favor of deprecating the current FHS locking mechanism > in favor of > an IOCTL when available. I think it will be available on all the > platforms but do not know for sure. > > The status is unchanged. I've had very few free cycles for > such things. > Feel free to take a stab at it if you have some time. I > believe the IOCTL > is used in the Mac OS X code already. > > I don't see any real backwards compatability issues and the > IOCTL should > just work. > > -- > Trent Jarvi > tjarvi at qbang.org > From sspies at sloc.de Thu Apr 24 07:15:36 2008 From: sspies at sloc.de (Sebastian Spies) Date: Thu, 24 Apr 2008 15:15:36 +0200 (CEST) Subject: [Rxtx] rxtx on gumstix: Interrupted system call In-Reply-To: <47FB7B20.7080504@sloc.de> References: <47FB7B20.7080504@sloc.de> Message-ID: <55445.130.83.139.205.1209042936.squirrel@ssl.sloc.de> Dear list, while porting rxtx to the gumstix, I found out, that select used in readArray in SerialImp.c might not work as expected. Maybe, because of missing TIOCSERGETLSR-support? select is often interrupted, so i wrote the following quick'n'dirty hack to make it work on gumstix: diff -Nur rxtx-2.1-7r2/src/SerialImp.c rxtx-2.1-7r2/src/SerialImp.c --- rxtx-2.1-7r2/src/SerialImp.c 2006-01-29 23:19:04.000000000 +0100 +++ rxtx-2.1-7r2-patched/src/SerialImp.c 2008-04-24 14:30:17.000000000 +0200 @@ -3380,7 +3381,7 @@ JNIEXPORT jint JNICALL RXTXPort(readArray)( JNIEnv *env, jobject jobj, jbyteArray jbarray, jint offset, jint length ) { - int bytes; + int bytes = 0; jbyte *body; /* char msg[80]; */ int fd = get_java_var( env, jobj, "fd", "I" ); @@ -3397,9 +3398,18 @@ "readArray", "Invalid length" ); return -1; } - body = (*env)->GetByteArrayElements( env, jbarray, 0 ); - bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ - (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + while(1 > bytes) + { + body = (*env)->GetByteArrayElements( env, jbarray, 0 ); + bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ + (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + // quick'n'dirty - SSP + report (" trying again... \n"); + errno = 0; + } + if( bytes < 0 ) { report( "RXTXPort:readArray bytes < 0" ); LEAVE( "RXTXPort:readArray" ); > Hey, > > I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use > RXTXPort$SerialInputStream.read(), then I get the following Exception. I > did not yet figure out which system call is interrupted as strace > produces loads of output. > > Any help would be very appreciated. Thanks in advance. > Sebastian > > > [java] java.io.IOException: Interrupted system call in readArray > [java] at gnu.io.RXTXPort.readArray(Native Method) > [java] at > gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) > [java] at > java.io.FilterInputStream.read(FilterInputStream.java:189) > [java] at > java.io.BufferedInputStream.refill(BufferedInputStream.java:371) > [java] at > java.io.BufferedInputStream.read(BufferedInputStream.java:229) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) > [java] at > com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) > > -- > Sebastian Spies > > mail: sspies at sloc.de > > > > From fire_baptized at hotmail.com Thu Apr 24 18:27:48 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Thu, 24 Apr 2008 20:27:48 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hello I am having a problem with the serial device connecting (software wise) to the serial port. However I have a test program and it seems to work just fine in that environment - and it doesnt use GUI. The error I am getting is : PortNotFoundException Now the way I have it setup in the GUI environment is that once the user pushes a JButton the program connects using this class: protected void establishConnection() { try { portId = CommPortIdentifier.getPortIdentifier("COM3"); System.out.println("Establishing connction....."); messages[0] = "\nEstablishing connction.....\n"; } catch ( NoSuchPortException noport) { System.out.println("Port not found: "+ noport); messages[0] = "Port not found: "+ noport+"\n"; } try { serialPort = (SerialPort) portId.open("serial", 50); System.out.println("Port has been found."); messages[1] = "Port has been found.\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[1] = "" +usedport; } try { serialPort = (SerialPort) portId.open("serial", 50); messages[2] = "Connecting to COM3 on port 50....\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; } try { serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); System.out.println("Esablishing the transfer rate settings for COM3."); messages[3] = "Esablishing the transfer rate settings for COM3.\n"; } catch (UnsupportedCommOperationException nosupcom) { System.out.println(nosupcom); System.out.println("The tranfer rate could not be esblished on COM3."); messages[3] = "The tranfer rate could not be esblished on COM3.\n"; } System.out.println(serialPort.getFlowControlMode()); messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; //sendDataOut(buffer[3],buffer[4]); } I need all the data in this method (and all the string values in this method) to be printed out on a JTextArea. I wont do me any good if not all the text is printed on a JTextArea in another class. So I have the text printing the JTextArea correctly, but everytime the JButton is activated - it gives me that error message. I did add a disconnect button that is supposed to call the serialPort.close(). _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/273fd4ec/attachment-0030.html From tjarvi at qbang.org Thu Apr 24 21:54:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Apr 2008 21:54:10 -0600 (MDT) Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > Hello I am having a problem with the serial device connecting (software > wise) to the serial port. However I have a test program and it seems to > work just fine in that environment - and it doesnt use GUI. The error I > am getting is : PortNotFoundException Now the way I have it setup in the > GUI environment is that once the user pushes a JButton the program > connects using this class: > > protected void establishConnection() { > try { > portId = CommPortIdentifier.getPortIdentifier("COM3"); > System.out.println("Establishing connction....."); > messages[0] = "\nEstablishing connction.....\n"; > } > catch ( NoSuchPortException noport) { > System.out.println("Port not found: "+ noport); > messages[0] = "Port not found: "+ noport+"\n"; > } > try { > serialPort = (SerialPort) portId.open("serial", 50); > System.out.println("Port has been found."); > messages[1] = "Port has been found.\n"; > } > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[1] = "" +usedport; > } ================================================================= > try { > serialPort = (SerialPort) portId.open("serial", 50); > messages[2] = "Connecting to COM3 on port 50....\n"; > } ================================================================== > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > } > try { > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > System.out.println("Esablishing the transfer rate settings for COM3."); > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > } > catch (UnsupportedCommOperationException nosupcom) { > System.out.println(nosupcom); > System.out.println("The tranfer rate could not be esblished on COM3."); > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > } > System.out.println(serialPort.getFlowControlMode()); > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > //sendDataOut(buffer[3],buffer[4]); > } > > I need all the data in this method (and all the string values in this > method) to be printed out on a JTextArea. I wont do me any good if not > all the text is printed on a JTextArea in another class. So I have the > text printing the JTextArea correctly, but everytime the JButton is > activated - it gives me that error message. I did add a disconnect > button that is supposed to call the serialPort.close(). > The open code used twice is going to throw an exception. It may be that you catch the exception above this code and print a confusing message? A common mistake is people will accidently run two copies of their program. The first instance of the program will open the port and prevent enumeration (finding the port) in the second instance of the program. As an example, you may be running your text based application which is preventing the GUI from seeing the port. Enumeration is done by trying to open the port. If the port is open, Enumeration fails. -- Trent Jarvi tjarvi at qbang.org From fire_baptized at hotmail.com Thu Apr 24 22:32:05 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 00:32:05 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Wow - thanks dude what a dumb thing for me to not catch..... now here is the current problem - right now I am trying to output data again one is with the test program - and it seems that serialPort.setRTS(true); is throwing an exceptions there - now if I show this code please bare in mind that I am only testing - the code is kinda sloppy in my mind - but if I can figure out why calling this function is throwing an exception then maybe I can figure out why my GUI application is getting the same null pointer exceptions when try to send out the data stream. FYI Trent this email is not directed towards you - anyone can jump in on this public static void main(String args[]) { byte[] b = new byte[64]; int keyinput = 0 ; byte x = 0; byte y = 0; PortTesting1 testports = new PortTesting1(); try { joyskoro = Joystick.createInstance(); } catch (IOException ioexc) { System.out.println("There is an input/output problem: " + ioexc); } while (true) { joyskoro.poll(); b[0] = ((byte) -(10 * joyskoro.getY())); b[1] = ((byte) (10 * joyskoro.getX())); System.out.println("The 3rd byte is: " +b[0]); System.out.println("The 4rd byte is: " +b[1]); serialPort.setRTS(true); // HERE IS WHERE THE PROBLEM IS !!!!!!! ON THIS LINE but if I dont have it active in my program the Bluetooth device (that is System.out.println("Ready to send :-) !"); //connected to the serial port does not send out data!!!!! if (joyskoro.isButtonDown(joyskoro.BUTTON10)) { System.out.println("Connection terminated."); serialPort.close(); break; } if (joyskoro.isButtonDown(joyskoro.BUTTON2)) { boolean flag = true; //reading from key input from the keyboard System.out.println("Please input a command: "); while (flag) { try { keyinput = System.in.read(); } catch (IOException ioexc) {/*there is no need to put * anything here */ } if((char)keyinput=='w') { pushIt((byte)85); } if((char)keyinput=='s') { pushIt((byte)84); } if((char)keyinput=='a') { pushIt((byte)83); } if((char)keyinput=='d') { pushIt((byte)82); } if((char)keyinput=='q') { pushIt((byte)89); } if((char)keyinput=='\t') { //this stop reading input from the keyboard flag = false; } } and help anyways here is the block of code that throwing an exception for the test program: > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/5c8f7d68/attachment-0030.html From fire_baptized at hotmail.com Fri Apr 25 07:59:53 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 09:59:53 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Are there any examples of how to push out data? As in using input and output streams - if I can compare code maybe I can see where this is causing a problem. I have a byte array that I am pushing out data. I keep getting null pointer exceptions every where I turn. > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/22228ab6/attachment-0029.html From ajmas at sympatico.ca Sat Apr 26 07:37:09 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 26 Apr 2008 09:37:09 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hi, On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote: > > Are there any examples of how to push out data? As in using input > and output streams - if I can compare code maybe I can see where > this is causing a problem. I have a byte array that I am pushing > out data. I keep getting null pointer exceptions every where I turn. > There are some examples here that might be of help: http://rxtx.qbang.org/wiki/index.php/Examples Andre From fire_baptized at hotmail.com Sat Apr 26 20:13:54 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Sat, 26 Apr 2008 22:13:54 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: looked at those....yep didnt help - I need to push out data with GUI and not get a null pointer exception everytime I try. > CC: rxtx at qbang.org> From: ajmas at sympatico.ca> To: fire_baptized at hotmail.com> Subject: Re: [Rxtx] Serial Problems with Gui.....> Date: Sat, 26 Apr 2008 09:37:09 -0400> > Hi,> > > On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote:> >> > Are there any examples of how to push out data? As in using input > > and output streams - if I can compare code maybe I can see where > > this is causing a problem. I have a byte array that I am pushing > > out data. I keep getting null pointer exceptions every where I turn.> >> > There are some examples here that might be of help:> > http://rxtx.qbang.org/wiki/index.php/Examples> > Andre _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080426/09f95b41/attachment-0028.html From michael.erskine at ketech.com Mon Apr 28 02:47:22 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 28 Apr 2008 09:47:22 +0100 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D426EF3CBBC5@no-sv-03.ketech.local> Jesrael D. Summerhill wrote: > looked at those....yep didnt help - I need to push out data with GUI and > not get a null pointer exception everytime I try. So it seems pretty obvious that your code needs to check for nulls wherever one may occur and report what's happening. Alternatively, catch the npe and display the stack trace. Then you can fix your code so it doesn't try to work with something that ain't there. Regards, Michael Erskine. From scldad at sdc.com.au Mon Apr 28 03:58:34 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Mon, 28 Apr 2008 19:28:34 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Message-ID: <200804281928.34454.scldad@sdc.com.au> Has anybody done any design work on this? The first thing that springs to mind is that we still need to check for lock files because other apps tend to use that approach even if we go to ioctl. Cheers, Stephen Davies On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > Thanks Trent. > > Problem is only that I'm really not at all > Familiar with the C part of RXTX. If there > Were anything I could do in Java for this, > It would be easier for me.... > > ... Are there any C experts here on the list > Who'd like to look at ioctl port locking > For linux? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > -----Original Message----- > > From: Trent Jarvi [mailto:tjarvi at qbang.org] > > Sent: Donnerstag, 24. April 2008 04:32 > > To: Oberhuber, Martin > > Cc: rxtx at qbang.org > > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > > > I'm wondering what the status is with RXTX locking > > > serial ports on Linux? > > > > > > My understanding is that the mechanism used in > > > 2.1-7r2 (lockfiles) is not really state of the art, and > > > has lots of problems (e.g. missing permissions). > > > > > > There was an idea to migrate towards a Kernel > > > syscall based solution for port locking. > > > > > > What's the status here? > > > > Hi Martin, > > > > I'm in favor of deprecating the current FHS locking mechanism > > in favor of > > an IOCTL when available. I think it will be available on all the > > platforms but do not know for sure. > > > > The status is unchanged. I've had very few free cycles for > > such things. > > Feel free to take a stab at it if you have some time. I > > believe the IOCTL > > is used in the Mac OS X code already. > > > > I don't see any real backwards compatability issues and the > > IOCTL should > > just work. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Mon Apr 28 04:21:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 28 Apr 2008 04:21:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804281928.34454.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: I don't think there would need to be any architectural changes. A couple ifdefs and minor changes in the current code should be enough. Proposal: FHS/UUCP locks: continue to respect them, try to create them but do not error if the IOCTL is supported. (But does the IOCTL being defined mean it will work?) Enumeration: Do not assert the IOCTL while opening. Serial.open: assert the IOCTL after open. Continue to use locks as described above after asserting the IOCTL. If the IOCTL is defined but not working, handle it here. Failure cases include the IOCTL is not supported and the port is already locked. On Mon, 28 Apr 2008, Stephen Davies wrote: > Has anybody done any design work on this? > The first thing that springs to mind is that we still need to check for lock > files because other apps tend to use that approach even if we go to ioctl. > > Cheers, > Stephen Davies > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: >> Thanks Trent. >> >> Problem is only that I'm really not at all >> Familiar with the C part of RXTX. If there >> Were anything I could do in Java for this, >> It would be easier for me.... >> >> ... Are there any C experts here on the list >> Who'd like to look at ioctl port locking >> For linux? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >>> -----Original Message----- >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] >>> Sent: Donnerstag, 24. April 2008 04:32 >>> To: Oberhuber, Martin >>> Cc: rxtx at qbang.org >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? >>> >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: >>>> Dear RXTX community, >>>> >>>> I'm wondering what the status is with RXTX locking >>>> serial ports on Linux? >>>> >>>> My understanding is that the mechanism used in >>>> 2.1-7r2 (lockfiles) is not really state of the art, and >>>> has lots of problems (e.g. missing permissions). >>>> >>>> There was an idea to migrate towards a Kernel >>>> syscall based solution for port locking. >>>> >>>> What's the status here? >>> >>> Hi Martin, >>> >>> I'm in favor of deprecating the current FHS locking mechanism >>> in favor of >>> an IOCTL when available. I think it will be available on all the >>> platforms but do not know for sure. >>> >>> The status is unchanged. I've had very few free cycles for >>> such things. >>> Feel free to take a stab at it if you have some time. I >>> believe the IOCTL >>> is used in the Mac OS X code already. >>> >>> I don't see any real backwards compatability issues and the >>> IOCTL should >>> just work. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Tue Apr 29 12:04:04 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Apr 2008 20:04:04 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Hi all, The biggest problem that I have seen with lockfiles on Linux At least is, that it seems there is no standard with respect To the folder in which they should be created. Also, many Distributions seem to set up file system permissions in such A way that writing to the lockfile folder is not allowed for The normal user -- that's why we stopped using lockfiles In our commercial product. If we are to still respect lockfiles, we first need to Understand where we are expected to look for them. Does Anybody have any insight what variants of lockfile folder Schema exist out there in the wild? Some apps like minicom Seem to even allow users to manually specify a lockfile Folder of their choice. Because of the difficulty finding the right lockfile folder, And because of the inherent risk of thinking that something Might be locked while it actually isn't, I'd suggest that RXTX should have a "soft-off" feature that allows disabling ALL Lockfile checks at runtime without recompiling the native Sharedlibs. Trent - I like your strategy outline, but I think that it Needs to be configurable by the client such that users and/or Customer Support can disable lockfiles / disable ioctl in Case they detect that they are runing on an OS / Kernal that Does not support one or the other. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Montag, 28. April 2008 12:22 > To: Stephen Davies > Cc: rxtx at qbang.org; Oberhuber, Martin; Trent Jarvi > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > I don't think there would need to be any architectural > changes. A couple > ifdefs and minor changes in the current code should be enough. > > Proposal: > > FHS/UUCP locks: > continue to respect them, try to create them but do not error if > the IOCTL is supported. (But does the IOCTL being defined mean > it will work?) > Enumeration: > Do not assert the IOCTL while opening. > Serial.open: > assert the IOCTL after open. Continue to use locks as described > above after asserting the IOCTL. If the IOCTL is defined but > not working, handle it here. Failure cases include the IOCTL > is not supported and the port is already locked. > > On Mon, 28 Apr 2008, Stephen Davies wrote: > > > Has anybody done any design work on this? > > The first thing that springs to mind is that we still need > to check for lock > > files because other apps tend to use that approach even if > we go to ioctl. > > > > Cheers, > > Stephen Davies > > > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > >> Thanks Trent. > >> > >> Problem is only that I'm really not at all > >> Familiar with the C part of RXTX. If there > >> Were anything I could do in Java for this, > >> It would be easier for me.... > >> > >> ... Are there any C experts here on the list > >> Who'd like to look at ioctl port locking > >> For linux? > >> > >> Thanks, > >> -- > >> Martin Oberhuber, Senior Member of Technical Staff, Wind River > >> Target Management Project Lead, DSDP PMC Member > >> http://www.eclipse.org/dsdp/tm > >> > >>> -----Original Message----- > >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] > >>> Sent: Donnerstag, 24. April 2008 04:32 > >>> To: Oberhuber, Martin > >>> Cc: rxtx at qbang.org > >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? > >>> > >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > >>>> Dear RXTX community, > >>>> > >>>> I'm wondering what the status is with RXTX locking > >>>> serial ports on Linux? > >>>> > >>>> My understanding is that the mechanism used in > >>>> 2.1-7r2 (lockfiles) is not really state of the art, and > >>>> has lots of problems (e.g. missing permissions). > >>>> > >>>> There was an idea to migrate towards a Kernel > >>>> syscall based solution for port locking. > >>>> > >>>> What's the status here? > >>> > >>> Hi Martin, > >>> > >>> I'm in favor of deprecating the current FHS locking mechanism > >>> in favor of > >>> an IOCTL when available. I think it will be available on all the > >>> platforms but do not know for sure. > >>> > >>> The status is unchanged. I've had very few free cycles for > >>> such things. > >>> Feel free to take a stab at it if you have some time. I > >>> believe the IOCTL > >>> is used in the Mac OS X code already. > >>> > >>> I don't see any real backwards compatability issues and the > >>> IOCTL should > >>> just work. > >>> > >>> -- > >>> Trent Jarvi > >>> tjarvi at qbang.org > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > From Steffen.DETTMER at ingenico.com Tue Apr 29 13:34:44 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 29 Apr 2008 21:34:44 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Message-ID: <20080429193444.GU2928@elberon.bln.de.ingenico.com> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > The biggest problem that I have seen with lockfiles on Linux > At least is, that it seems there is no standard with respect > To the folder in which they should be created. Also, many > Distributions seem to set up file system permissions in such > A way that writing to the lockfile folder is not allowed for > The normal user -- that's why we stopped using lockfiles > In our commercial product. It seems it depends on the expectations. I consider it as a feature that by default a linux user cannot access serial ports. Maybe root connected a modem (can produce phone bills) or even some serial card reader, maybe with the web servers key pair. I would expect that by default a user cannot open the serial port because of insufficient permissions on the device file. I would expect this on other unices as well (but I don't know it). For windows I think it should be similar but not impacting so much in practice, because often windows users work with big permissions on a somewhat high priviledge level or even Administrator. > If we are to still respect lockfiles, we first need to > Understand where we are expected to look for them. Does > Anybody have any insight what variants of lockfile folder > Schema exist out there in the wild? Some apps like minicom > Seem to even allow users to manually specify a lockfile > Folder of their choice. At least my (ancient) minicom does not allow the user to change this option, it is displayed but read-only, but root is allowed to change it. > Because of the difficulty finding the right lockfile folder, > And because of the inherent risk of thinking that something > Might be locked while it actually isn't, I'd suggest that > RXTX should have a "soft-off" feature that allows disabling > ALL Lockfile checks at runtime without recompiling the native > Sharedlibs. sounds very reasonable, yes... and as admin I would not wish that users could skip such locking because they do things wrong by default ;) (in the end I guess that is related to the dilemma, that hotplug/user-owned-periphery and multi-user systems simply conflict) > Trent - I like your strategy outline, but I think that it > Needs to be configurable by the client such that users and/or > Customer Support can disable lockfiles / disable ioctl in > Case they detect that they are runing on an OS / Kernal that > Does not support one or the other. Yes, this would be good I guess... Applications could offer configuration options to control that, maybe similarily as minicom. BTW, man minicom tells: *B - Lock file location On most systems This should be /usr/spool/uucp. Linux systems use /var/lock. If this directory does not exist, minicom will not attempt to use lockfiles. The statement `Linux systems use /var/lock' is interesting, does anyone know the source of this convention? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Tue Apr 29 16:11:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Apr 2008 16:11:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? These details are outlined in the Filesystem Hierarchy Standard (FHS). http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLOCKLOCKFILES -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Tue Apr 29 18:58:09 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Wed, 30 Apr 2008 10:28:09 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: <200804301028.09307.scldad@sdc.com.au> I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is the same. Any ideas as to how to handle this? Stephen On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: > * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > > The biggest problem that I have seen with lockfiles on Linux > > At least is, that it seems there is no standard with respect > > To the folder in which they should be created. Also, many > > Distributions seem to set up file system permissions in such > > A way that writing to the lockfile folder is not allowed for > > The normal user -- that's why we stopped using lockfiles > > In our commercial product. > > It seems it depends on the expectations. I consider it as a > feature that by default a linux user cannot access serial ports. > Maybe root connected a modem (can produce phone bills) or even > some serial card reader, maybe with the web servers key pair. > > I would expect that by default a user cannot open the serial port > because of insufficient permissions on the device file. I would > expect this on other unices as well (but I don't know it). > > For windows I think it should be similar but not impacting so > much in practice, because often windows users work with big > permissions on a somewhat high priviledge level or even > Administrator. > > > If we are to still respect lockfiles, we first need to > > Understand where we are expected to look for them. Does > > Anybody have any insight what variants of lockfile folder > > Schema exist out there in the wild? Some apps like minicom > > Seem to even allow users to manually specify a lockfile > > Folder of their choice. > > At least my (ancient) minicom does not allow the user to change > this option, it is displayed but read-only, but root is allowed > to change it. > > > Because of the difficulty finding the right lockfile folder, > > And because of the inherent risk of thinking that something > > Might be locked while it actually isn't, I'd suggest that > > RXTX should have a "soft-off" feature that allows disabling > > ALL Lockfile checks at runtime without recompiling the native > > Sharedlibs. > > sounds very reasonable, yes... > and as admin I would not wish that users could skip such > locking because they do things wrong by default ;) > > (in the end I guess that is related to the dilemma, that > hotplug/user-owned-periphery and multi-user systems simply > conflict) > > > Trent - I like your strategy outline, but I think that it > > Needs to be configurable by the client such that users and/or > > Customer Support can disable lockfiles / disable ioctl in > > Case they detect that they are runing on an OS / Kernal that > > Does not support one or the other. > > Yes, this would be good I guess... Applications could offer > configuration options to control that, maybe similarily as > minicom. > > BTW, man minicom tells: > > *B - Lock file location > On most systems This should be /usr/spool/uucp. > Linux systems use /var/lock. If this directory > does not exist, minicom will not attempt to use > lockfiles. > > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure > and expedient electronic transaction acceptance. Ingenico products leverage > proven technology, established standards and unparalleled ergonomics to > provide optimal reliability, versatility and usability. This comprehensive > range of products is complemented by a global array of services and > partnerships, enabling businesses in a number of vertical sectors to accept > transactions anywhere their business takes them. www.ingenico.com This > message may contain confidential and/or privileged information. If you are > not the addressee or authorized to receive this for the addressee, you must > not use, copy, disclose or take any action based on this message or any > information herein. If you have received this message in error, please > advise the sender immediately by reply e-mail and delete this message. > Thank you for your cooperation. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Wed Apr 30 19:30:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 30 Apr 2008 19:30:51 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804301028.09307.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> <200804301028.09307.scldad@sdc.com.au> Message-ID: Hi Stephen, I suspect ioctl/TIOCEXCL open/O_EXCL would do the job. Mac uses TIOCEXCL and it is POSIX. We use O_EXCL for lockfiles on Linux already. On Wed, 30 Apr 2008, Stephen Davies wrote: > I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is > the same. > > Any ideas as to how to handle this? > > Stephen > > > On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: >> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: >>> The biggest problem that I have seen with lockfiles on Linux >>> At least is, that it seems there is no standard with respect >>> To the folder in which they should be created. Also, many >>> Distributions seem to set up file system permissions in such >>> A way that writing to the lockfile folder is not allowed for >>> The normal user -- that's why we stopped using lockfiles >>> In our commercial product. >> >> It seems it depends on the expectations. I consider it as a >> feature that by default a linux user cannot access serial ports. >> Maybe root connected a modem (can produce phone bills) or even >> some serial card reader, maybe with the web servers key pair. >> >> I would expect that by default a user cannot open the serial port >> because of insufficient permissions on the device file. I would >> expect this on other unices as well (but I don't know it). >> >> For windows I think it should be similar but not impacting so >> much in practice, because often windows users work with big >> permissions on a somewhat high priviledge level or even >> Administrator. >> >>> If we are to still respect lockfiles, we first need to >>> Understand where we are expected to look for them. Does >>> Anybody have any insight what variants of lockfile folder >>> Schema exist out there in the wild? Some apps like minicom >>> Seem to even allow users to manually specify a lockfile >>> Folder of their choice. >> >> At least my (ancient) minicom does not allow the user to change >> this option, it is displayed but read-only, but root is allowed >> to change it. >> >>> Because of the difficulty finding the right lockfile folder, >>> And because of the inherent risk of thinking that something >>> Might be locked while it actually isn't, I'd suggest that >>> RXTX should have a "soft-off" feature that allows disabling >>> ALL Lockfile checks at runtime without recompiling the native >>> Sharedlibs. >> >> sounds very reasonable, yes... >> and as admin I would not wish that users could skip such >> locking because they do things wrong by default ;) >> >> (in the end I guess that is related to the dilemma, that >> hotplug/user-owned-periphery and multi-user systems simply >> conflict) >> >>> Trent - I like your strategy outline, but I think that it >>> Needs to be configurable by the client such that users and/or >>> Customer Support can disable lockfiles / disable ioctl in >>> Case they detect that they are runing on an OS / Kernal that >>> Does not support one or the other. >> >> Yes, this would be good I guess... Applications could offer >> configuration options to control that, maybe similarily as >> minicom. >> >> BTW, man minicom tells: >> >> *B - Lock file location >> On most systems This should be /usr/spool/uucp. >> Linux systems use /var/lock. If this directory >> does not exist, minicom will not attempt to use >> lockfiles. >> >> The statement `Linux systems use /var/lock' is interesting, does >> anyone know the source of this convention? >> >> oki, >> >> Steffen >> >> About Ingenico Throughout the world businesses rely on Ingenico for secure >> and expedient electronic transaction acceptance. Ingenico products leverage >> proven technology, established standards and unparalleled ergonomics to >> provide optimal reliability, versatility and usability. This comprehensive >> range of products is complemented by a global array of services and >> partnerships, enabling businesses in a number of vertical sectors to accept >> transactions anywhere their business takes them. www.ingenico.com This >> message may contain confidential and/or privileged information. If you are >> not the addressee or authorized to receive this for the addressee, you must >> not use, copy, disclose or take any action based on this message or any >> information herein. If you have received this message in error, please >> advise the sender immediately by reply e-mail and delete this message. >> Thank you for your cooperation. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0054.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0052.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0039.html From pboulton at pulsetracer.com Fri Apr 18 14:30:13 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Fri, 18 Apr 2008 13:30:13 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site Message-ID: <480904D5.1060307@pulsetracer.com> Hello, gentle serial porters. I have downloaded the zipped up binaries for use on Windows without Sun's CommAPI, but don't seem able to extract anything from the download. Go to main page, http://www.rxtx.org/ Click on Downloads I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) And I save it to disk. If I try and extract the files with WinZip, Winzip thinks the archive is corrupt. If I try using Windows Explorer, I am able to extract it into a single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than the original .zip. Any help would be much appreciated. Sincerely, Philip Boulton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080418/97d89793/attachment-0037.html From tjarvi at qbang.org Fri Apr 18 19:07:00 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 18 Apr 2008 19:07:00 -0600 (MDT) Subject: [Rxtx] Difficulty opening zip file at rxtx site In-Reply-To: <480904D5.1060307@pulsetracer.com> References: <480904D5.1060307@pulsetracer.com> Message-ID: On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org From pboulton at pulsetracer.com Sat Apr 19 12:46:26 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Sat, 19 Apr 2008 11:46:26 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site References: <480904D5.1060307@pulsetracer.com> Message-ID: <53DB7576450695419E09299104043761A78533@ZTGSERVER.ztg.local> I have been able to get my hands on the binaries, by going to the ftp directory /pub/rxtx at ftp.qbang.org,, and ftping the file rxtx-2.1-7-bins-r2.zip . This opens happily with Winzip, and extracts as the set of files that you describe below. I only experience the ill-formed archive problem by clicking the link on the rxtx.org Downloads page (http://rxtx.qbang.org/pub/rxtx/ rxtx-2.1-7-bins-r2.zip ). Not sure what to make of that. Philip Boulton ________________________________ From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Fri 4/18/2008 6:07 PM To: Philip Boulton Cc: rxtx at qbang.org Subject: Re: [Rxtx] Difficulty opening zip file at rxtx site On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080419/147923bb/attachment-0036.html From jlar310 at gmail.com Sat Apr 19 19:11:55 2008 From: jlar310 at gmail.com (Jeff Larsen) Date: Sat, 19 Apr 2008 20:11:55 -0500 Subject: [Rxtx] Moxa serial over Ethernet driver Message-ID: Hi all, I've been using javax.comm for years to communicate with a legacy radio data system. We want to migrate the java side of the system to a VMware Server virtual machine. We've had great success using Moxa DE-303 and 5610 serial over Ethernet appliances and virtual machines for running hylafax. The OS (Linux in this case) uses a kernel driver to communicate with the Moxa via a virtual serial port such as /dev/ttyr00. I want to do the same thing with javax.comm or gnu.io to connect to a virtual serial port. However I'm hitting road blocks everywhere. javax.comm for Linux sees the virtual port, but there are transmission errors. Tried Solaris too, but the Solaris Moxa drivers don't play nice with javax.comm because the driver uses /dev/pts/n instead of /dev/term/x. Next I tried RXTX on Linux, but I'm getting NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX on Solaris. Has anyone used RXTX with serial over Ethernet devices? Any hints on how to make it work? I know that I'm not completely off track because javax.comm does work with Moxa on a Windows platform, but that's just not an option for production deployment. -- Jeff From tjarvi at qbang.org Sat Apr 19 21:08:41 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 19 Apr 2008 21:08:41 -0600 (MDT) Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: yOn Sat, 19 Apr 2008, Jeff Larsen wrote: > Hi all, > > I've been using javax.comm for years to communicate with a legacy > radio data system. We want to migrate the java side of the system to a > VMware Server virtual machine. We've had great success using Moxa > DE-303 and 5610 serial over Ethernet appliances and virtual machines > for running hylafax. The OS (Linux in this case) uses a kernel driver > to communicate with the Moxa via a virtual serial port such as > /dev/ttyr00. > > I want to do the same thing with javax.comm or gnu.io to connect to a > virtual serial port. However I'm hitting road blocks everywhere. > javax.comm for Linux sees the virtual port, but there are transmission > errors. Tried Solaris too, but the Solaris Moxa drivers don't play > nice with javax.comm because the driver uses /dev/pts/n instead of > /dev/term/x. Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris. > > Has anyone used RXTX with serial over Ethernet devices? Any hints on > how to make it work? > > I know that I'm not completely off track because javax.comm does work > with Moxa on a Windows platform, but that's just not an option for > production deployment. > > Moxa should work under linux. There may be minor issues depending upon how complete the kernel driver is but I think it will work. One of the minor issues is /dev/ttyr00 is not enumerated. There are several work arounds documented with the source code and on the wiki. The easiest solution for testing purposes is to make a symbolic link from /dev/ttyr00 to a port that is enumerated such as /dev/ttyS129. You can later alter the rxtx source or use properties to change the enumerated ports. -- Trent Jarvi tjarvi at qbang.org From d.tonhofer at m-plify.com Sun Apr 20 03:33:30 2008 From: d.tonhofer at m-plify.com (David Tonhofer (M-PLIFY S.A.)) Date: Sun, 20 Apr 2008 11:33:30 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: <480B0DEA.5010908@m-plify.com> Jeff Larsen wrote: > Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris It might be that the Java side of RXTX does not recognize that portname. Trying modifying src/RXTXCommDriver.java as described in this case: http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card From ajmas at sympatico.ca Sun Apr 20 16:37:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Apr 2008 18:37:59 -0400 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <480B0DEA.5010908@m-plify.com> References: <480B0DEA.5010908@m-plify.com> Message-ID: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > Jeff Larsen wrote: >> Next I tried RXTX on Linux, but I'm getting >> NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX >> on Solaris > It might be that the Java side of RXTX does not recognize that > portname. > Trying modifying src/RXTXCommDriver.java as described in this case: > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card I wonder whether it would be worth allowing custom port prefixes as a system parameter? For example: gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" Andre From Martin.Oberhuber at windriver.com Tue Apr 22 12:34:36 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 22 Apr 2008 20:34:36 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> References: <480B0DEA.5010908@m-plify.com> <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE6485848056CD6CE@ism-mail03.corp.ad.wrs.com> Sounds like a great idea... I'm wondering how the "variable part" after the Prefixes could be specified though? What about allowing Regular Expression character Classes in the existing System Property for specifying ports: System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyS[0-9],ttyS[ABC],ttyUSB[0-9a-z]"); The set of allowed patterns would of course need to Be restricted compared to REGEX, because it must be A syntax that supports iterating over it. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Montag, 21. April 2008 00:38 > To: rxtx at qbang.org and Users > Subject: Re: [Rxtx] Moxa serial over Ethernet driver > > > On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > > Jeff Larsen wrote: > >> Next I tried RXTX on Linux, but I'm getting > >> NoSuchPortException connecting to /dev/ttyr00. I have yet > to try RXTX > >> on Solaris > > It might be that the Java side of RXTX does not recognize that > > portname. > > Trying modifying src/RXTXCommDriver.java as described in this case: > > > > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_ > SST-4P.2FLP_multiport_card > > I wonder whether it would be worth allowing custom port > prefixes as a > system parameter? For > example: > > gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Loi.TRAN at weatherford.com Tue Apr 22 13:10:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Tue, 22 Apr 2008 14:10:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled Message-ID: Hi, I'm currently using the Java RXTX API to interface to a serial port. The serial port is connected to a bridge board that communicates with our communications system running at 1.875 Mbps which is linked to an embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no flow control). I send a command to the embedded board through the serial-bridge board which then is relayed to the embedded board. The command sent asks the embedded board to dump a binary image. Here's where I'm hitting some problems. I've successfully done this is an integrated serial port from the laptop. The binary file that comes back is consistent on every attempt. When I use the application I've written to do the same thing with a USB-to-serial adapter, the image I get back is not the same as the image I receive through the USB-to-serial adapter is not consistent at all. A final thing is that when I use a terminal program to dump the binary image with the USB-serial adapter, the image is correct. Every time! What is the terminal program doing that's not being done in my application? My application is quite simple. Has anyone observed this behavior before? If you have, I'd like to know how you've gotten around this problem. Thanks, LT =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From tjarvi at qbang.org Tue Apr 22 21:11:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 22 Apr 2008 21:11:10 -0600 (MDT) Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org From Loi.TRAN at weatherford.com Wed Apr 23 08:35:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Wed, 23 Apr 2008 09:35:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: Thanks for all the responses. I finally tried something that worked consistently. I updated my Prolific driver and repeated my tests. It worked. If you're using the Prolific type USB-serial adapters, do no use the Prolific version 2.0.2.1 driver on Windows. Update it to the latest 2.0.2.8 version. Again, thanks for all the responses. LT -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Tuesday, April 22, 2008 10:11 PM To: TRAN, Loi X. Cc: rxtx at qbang.org Subject: Re: [Rxtx] Prolific USB - RXTX data mangled On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From Martin.Oberhuber at windriver.com Wed Apr 23 18:54:26 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 02:54:26 +0200 Subject: [Rxtx] RXTX port locking on Linux status? Message-ID: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Dear RXTX community, I'm wondering what the status is with RXTX locking serial ports on Linux? My understanding is that the mechanism used in 2.1-7r2 (lockfiles) is not really state of the art, and has lots of problems (e.g. missing permissions). There was an idea to migrate towards a Kernel syscall based solution for port locking. What's the status here? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/9878db9f/attachment-0032.html From tjarvi at qbang.org Wed Apr 23 20:32:24 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Apr 2008 20:32:24 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > Dear RXTX community, > > I'm wondering what the status is with RXTX locking > serial ports on Linux? > > My understanding is that the mechanism used in > 2.1-7r2 (lockfiles) is not really state of the art, and > has lots of problems (e.g. missing permissions). > > There was an idea to migrate towards a Kernel > syscall based solution for port locking. > > What's the status here? > Hi Martin, I'm in favor of deprecating the current FHS locking mechanism in favor of an IOCTL when available. I think it will be available on all the platforms but do not know for sure. The status is unchanged. I've had very few free cycles for such things. Feel free to take a stab at it if you have some time. I believe the IOCTL is used in the Mac OS X code already. I don't see any real backwards compatability issues and the IOCTL should just work. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Apr 24 06:14:06 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 14:14:06 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Thanks Trent. Problem is only that I'm really not at all Familiar with the C part of RXTX. If there Were anything I could do in Java for this, It would be easier for me.... ... Are there any C experts here on the list Who'd like to look at ioctl port locking For linux? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Donnerstag, 24. April 2008 04:32 > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > I'm wondering what the status is with RXTX locking > > serial ports on Linux? > > > > My understanding is that the mechanism used in > > 2.1-7r2 (lockfiles) is not really state of the art, and > > has lots of problems (e.g. missing permissions). > > > > There was an idea to migrate towards a Kernel > > syscall based solution for port locking. > > > > What's the status here? > > > > Hi Martin, > > I'm in favor of deprecating the current FHS locking mechanism > in favor of > an IOCTL when available. I think it will be available on all the > platforms but do not know for sure. > > The status is unchanged. I've had very few free cycles for > such things. > Feel free to take a stab at it if you have some time. I > believe the IOCTL > is used in the Mac OS X code already. > > I don't see any real backwards compatability issues and the > IOCTL should > just work. > > -- > Trent Jarvi > tjarvi at qbang.org > From sspies at sloc.de Thu Apr 24 07:15:36 2008 From: sspies at sloc.de (Sebastian Spies) Date: Thu, 24 Apr 2008 15:15:36 +0200 (CEST) Subject: [Rxtx] rxtx on gumstix: Interrupted system call In-Reply-To: <47FB7B20.7080504@sloc.de> References: <47FB7B20.7080504@sloc.de> Message-ID: <55445.130.83.139.205.1209042936.squirrel@ssl.sloc.de> Dear list, while porting rxtx to the gumstix, I found out, that select used in readArray in SerialImp.c might not work as expected. Maybe, because of missing TIOCSERGETLSR-support? select is often interrupted, so i wrote the following quick'n'dirty hack to make it work on gumstix: diff -Nur rxtx-2.1-7r2/src/SerialImp.c rxtx-2.1-7r2/src/SerialImp.c --- rxtx-2.1-7r2/src/SerialImp.c 2006-01-29 23:19:04.000000000 +0100 +++ rxtx-2.1-7r2-patched/src/SerialImp.c 2008-04-24 14:30:17.000000000 +0200 @@ -3380,7 +3381,7 @@ JNIEXPORT jint JNICALL RXTXPort(readArray)( JNIEnv *env, jobject jobj, jbyteArray jbarray, jint offset, jint length ) { - int bytes; + int bytes = 0; jbyte *body; /* char msg[80]; */ int fd = get_java_var( env, jobj, "fd", "I" ); @@ -3397,9 +3398,18 @@ "readArray", "Invalid length" ); return -1; } - body = (*env)->GetByteArrayElements( env, jbarray, 0 ); - bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ - (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + while(1 > bytes) + { + body = (*env)->GetByteArrayElements( env, jbarray, 0 ); + bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ + (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + // quick'n'dirty - SSP + report (" trying again... \n"); + errno = 0; + } + if( bytes < 0 ) { report( "RXTXPort:readArray bytes < 0" ); LEAVE( "RXTXPort:readArray" ); > Hey, > > I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use > RXTXPort$SerialInputStream.read(), then I get the following Exception. I > did not yet figure out which system call is interrupted as strace > produces loads of output. > > Any help would be very appreciated. Thanks in advance. > Sebastian > > > [java] java.io.IOException: Interrupted system call in readArray > [java] at gnu.io.RXTXPort.readArray(Native Method) > [java] at > gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) > [java] at > java.io.FilterInputStream.read(FilterInputStream.java:189) > [java] at > java.io.BufferedInputStream.refill(BufferedInputStream.java:371) > [java] at > java.io.BufferedInputStream.read(BufferedInputStream.java:229) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) > [java] at > com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) > > -- > Sebastian Spies > > mail: sspies at sloc.de > > > > From fire_baptized at hotmail.com Thu Apr 24 18:27:48 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Thu, 24 Apr 2008 20:27:48 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hello I am having a problem with the serial device connecting (software wise) to the serial port. However I have a test program and it seems to work just fine in that environment - and it doesnt use GUI. The error I am getting is : PortNotFoundException Now the way I have it setup in the GUI environment is that once the user pushes a JButton the program connects using this class: protected void establishConnection() { try { portId = CommPortIdentifier.getPortIdentifier("COM3"); System.out.println("Establishing connction....."); messages[0] = "\nEstablishing connction.....\n"; } catch ( NoSuchPortException noport) { System.out.println("Port not found: "+ noport); messages[0] = "Port not found: "+ noport+"\n"; } try { serialPort = (SerialPort) portId.open("serial", 50); System.out.println("Port has been found."); messages[1] = "Port has been found.\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[1] = "" +usedport; } try { serialPort = (SerialPort) portId.open("serial", 50); messages[2] = "Connecting to COM3 on port 50....\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; } try { serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); System.out.println("Esablishing the transfer rate settings for COM3."); messages[3] = "Esablishing the transfer rate settings for COM3.\n"; } catch (UnsupportedCommOperationException nosupcom) { System.out.println(nosupcom); System.out.println("The tranfer rate could not be esblished on COM3."); messages[3] = "The tranfer rate could not be esblished on COM3.\n"; } System.out.println(serialPort.getFlowControlMode()); messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; //sendDataOut(buffer[3],buffer[4]); } I need all the data in this method (and all the string values in this method) to be printed out on a JTextArea. I wont do me any good if not all the text is printed on a JTextArea in another class. So I have the text printing the JTextArea correctly, but everytime the JButton is activated - it gives me that error message. I did add a disconnect button that is supposed to call the serialPort.close(). _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/273fd4ec/attachment-0031.html From tjarvi at qbang.org Thu Apr 24 21:54:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Apr 2008 21:54:10 -0600 (MDT) Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > Hello I am having a problem with the serial device connecting (software > wise) to the serial port. However I have a test program and it seems to > work just fine in that environment - and it doesnt use GUI. The error I > am getting is : PortNotFoundException Now the way I have it setup in the > GUI environment is that once the user pushes a JButton the program > connects using this class: > > protected void establishConnection() { > try { > portId = CommPortIdentifier.getPortIdentifier("COM3"); > System.out.println("Establishing connction....."); > messages[0] = "\nEstablishing connction.....\n"; > } > catch ( NoSuchPortException noport) { > System.out.println("Port not found: "+ noport); > messages[0] = "Port not found: "+ noport+"\n"; > } > try { > serialPort = (SerialPort) portId.open("serial", 50); > System.out.println("Port has been found."); > messages[1] = "Port has been found.\n"; > } > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[1] = "" +usedport; > } ================================================================= > try { > serialPort = (SerialPort) portId.open("serial", 50); > messages[2] = "Connecting to COM3 on port 50....\n"; > } ================================================================== > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > } > try { > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > System.out.println("Esablishing the transfer rate settings for COM3."); > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > } > catch (UnsupportedCommOperationException nosupcom) { > System.out.println(nosupcom); > System.out.println("The tranfer rate could not be esblished on COM3."); > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > } > System.out.println(serialPort.getFlowControlMode()); > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > //sendDataOut(buffer[3],buffer[4]); > } > > I need all the data in this method (and all the string values in this > method) to be printed out on a JTextArea. I wont do me any good if not > all the text is printed on a JTextArea in another class. So I have the > text printing the JTextArea correctly, but everytime the JButton is > activated - it gives me that error message. I did add a disconnect > button that is supposed to call the serialPort.close(). > The open code used twice is going to throw an exception. It may be that you catch the exception above this code and print a confusing message? A common mistake is people will accidently run two copies of their program. The first instance of the program will open the port and prevent enumeration (finding the port) in the second instance of the program. As an example, you may be running your text based application which is preventing the GUI from seeing the port. Enumeration is done by trying to open the port. If the port is open, Enumeration fails. -- Trent Jarvi tjarvi at qbang.org From fire_baptized at hotmail.com Thu Apr 24 22:32:05 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 00:32:05 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Wow - thanks dude what a dumb thing for me to not catch..... now here is the current problem - right now I am trying to output data again one is with the test program - and it seems that serialPort.setRTS(true); is throwing an exceptions there - now if I show this code please bare in mind that I am only testing - the code is kinda sloppy in my mind - but if I can figure out why calling this function is throwing an exception then maybe I can figure out why my GUI application is getting the same null pointer exceptions when try to send out the data stream. FYI Trent this email is not directed towards you - anyone can jump in on this public static void main(String args[]) { byte[] b = new byte[64]; int keyinput = 0 ; byte x = 0; byte y = 0; PortTesting1 testports = new PortTesting1(); try { joyskoro = Joystick.createInstance(); } catch (IOException ioexc) { System.out.println("There is an input/output problem: " + ioexc); } while (true) { joyskoro.poll(); b[0] = ((byte) -(10 * joyskoro.getY())); b[1] = ((byte) (10 * joyskoro.getX())); System.out.println("The 3rd byte is: " +b[0]); System.out.println("The 4rd byte is: " +b[1]); serialPort.setRTS(true); // HERE IS WHERE THE PROBLEM IS !!!!!!! ON THIS LINE but if I dont have it active in my program the Bluetooth device (that is System.out.println("Ready to send :-) !"); //connected to the serial port does not send out data!!!!! if (joyskoro.isButtonDown(joyskoro.BUTTON10)) { System.out.println("Connection terminated."); serialPort.close(); break; } if (joyskoro.isButtonDown(joyskoro.BUTTON2)) { boolean flag = true; //reading from key input from the keyboard System.out.println("Please input a command: "); while (flag) { try { keyinput = System.in.read(); } catch (IOException ioexc) {/*there is no need to put * anything here */ } if((char)keyinput=='w') { pushIt((byte)85); } if((char)keyinput=='s') { pushIt((byte)84); } if((char)keyinput=='a') { pushIt((byte)83); } if((char)keyinput=='d') { pushIt((byte)82); } if((char)keyinput=='q') { pushIt((byte)89); } if((char)keyinput=='\t') { //this stop reading input from the keyboard flag = false; } } and help anyways here is the block of code that throwing an exception for the test program: > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/5c8f7d68/attachment-0031.html From fire_baptized at hotmail.com Fri Apr 25 07:59:53 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 09:59:53 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Are there any examples of how to push out data? As in using input and output streams - if I can compare code maybe I can see where this is causing a problem. I have a byte array that I am pushing out data. I keep getting null pointer exceptions every where I turn. > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/22228ab6/attachment-0030.html From ajmas at sympatico.ca Sat Apr 26 07:37:09 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 26 Apr 2008 09:37:09 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hi, On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote: > > Are there any examples of how to push out data? As in using input > and output streams - if I can compare code maybe I can see where > this is causing a problem. I have a byte array that I am pushing > out data. I keep getting null pointer exceptions every where I turn. > There are some examples here that might be of help: http://rxtx.qbang.org/wiki/index.php/Examples Andre From fire_baptized at hotmail.com Sat Apr 26 20:13:54 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Sat, 26 Apr 2008 22:13:54 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: looked at those....yep didnt help - I need to push out data with GUI and not get a null pointer exception everytime I try. > CC: rxtx at qbang.org> From: ajmas at sympatico.ca> To: fire_baptized at hotmail.com> Subject: Re: [Rxtx] Serial Problems with Gui.....> Date: Sat, 26 Apr 2008 09:37:09 -0400> > Hi,> > > On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote:> >> > Are there any examples of how to push out data? As in using input > > and output streams - if I can compare code maybe I can see where > > this is causing a problem. I have a byte array that I am pushing > > out data. I keep getting null pointer exceptions every where I turn.> >> > There are some examples here that might be of help:> > http://rxtx.qbang.org/wiki/index.php/Examples> > Andre _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080426/09f95b41/attachment-0029.html From michael.erskine at ketech.com Mon Apr 28 02:47:22 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 28 Apr 2008 09:47:22 +0100 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D426EF3CBBC5@no-sv-03.ketech.local> Jesrael D. Summerhill wrote: > looked at those....yep didnt help - I need to push out data with GUI and > not get a null pointer exception everytime I try. So it seems pretty obvious that your code needs to check for nulls wherever one may occur and report what's happening. Alternatively, catch the npe and display the stack trace. Then you can fix your code so it doesn't try to work with something that ain't there. Regards, Michael Erskine. From scldad at sdc.com.au Mon Apr 28 03:58:34 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Mon, 28 Apr 2008 19:28:34 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Message-ID: <200804281928.34454.scldad@sdc.com.au> Has anybody done any design work on this? The first thing that springs to mind is that we still need to check for lock files because other apps tend to use that approach even if we go to ioctl. Cheers, Stephen Davies On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > Thanks Trent. > > Problem is only that I'm really not at all > Familiar with the C part of RXTX. If there > Were anything I could do in Java for this, > It would be easier for me.... > > ... Are there any C experts here on the list > Who'd like to look at ioctl port locking > For linux? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > -----Original Message----- > > From: Trent Jarvi [mailto:tjarvi at qbang.org] > > Sent: Donnerstag, 24. April 2008 04:32 > > To: Oberhuber, Martin > > Cc: rxtx at qbang.org > > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > > > I'm wondering what the status is with RXTX locking > > > serial ports on Linux? > > > > > > My understanding is that the mechanism used in > > > 2.1-7r2 (lockfiles) is not really state of the art, and > > > has lots of problems (e.g. missing permissions). > > > > > > There was an idea to migrate towards a Kernel > > > syscall based solution for port locking. > > > > > > What's the status here? > > > > Hi Martin, > > > > I'm in favor of deprecating the current FHS locking mechanism > > in favor of > > an IOCTL when available. I think it will be available on all the > > platforms but do not know for sure. > > > > The status is unchanged. I've had very few free cycles for > > such things. > > Feel free to take a stab at it if you have some time. I > > believe the IOCTL > > is used in the Mac OS X code already. > > > > I don't see any real backwards compatability issues and the > > IOCTL should > > just work. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Mon Apr 28 04:21:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 28 Apr 2008 04:21:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804281928.34454.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: I don't think there would need to be any architectural changes. A couple ifdefs and minor changes in the current code should be enough. Proposal: FHS/UUCP locks: continue to respect them, try to create them but do not error if the IOCTL is supported. (But does the IOCTL being defined mean it will work?) Enumeration: Do not assert the IOCTL while opening. Serial.open: assert the IOCTL after open. Continue to use locks as described above after asserting the IOCTL. If the IOCTL is defined but not working, handle it here. Failure cases include the IOCTL is not supported and the port is already locked. On Mon, 28 Apr 2008, Stephen Davies wrote: > Has anybody done any design work on this? > The first thing that springs to mind is that we still need to check for lock > files because other apps tend to use that approach even if we go to ioctl. > > Cheers, > Stephen Davies > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: >> Thanks Trent. >> >> Problem is only that I'm really not at all >> Familiar with the C part of RXTX. If there >> Were anything I could do in Java for this, >> It would be easier for me.... >> >> ... Are there any C experts here on the list >> Who'd like to look at ioctl port locking >> For linux? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >>> -----Original Message----- >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] >>> Sent: Donnerstag, 24. April 2008 04:32 >>> To: Oberhuber, Martin >>> Cc: rxtx at qbang.org >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? >>> >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: >>>> Dear RXTX community, >>>> >>>> I'm wondering what the status is with RXTX locking >>>> serial ports on Linux? >>>> >>>> My understanding is that the mechanism used in >>>> 2.1-7r2 (lockfiles) is not really state of the art, and >>>> has lots of problems (e.g. missing permissions). >>>> >>>> There was an idea to migrate towards a Kernel >>>> syscall based solution for port locking. >>>> >>>> What's the status here? >>> >>> Hi Martin, >>> >>> I'm in favor of deprecating the current FHS locking mechanism >>> in favor of >>> an IOCTL when available. I think it will be available on all the >>> platforms but do not know for sure. >>> >>> The status is unchanged. I've had very few free cycles for >>> such things. >>> Feel free to take a stab at it if you have some time. I >>> believe the IOCTL >>> is used in the Mac OS X code already. >>> >>> I don't see any real backwards compatability issues and the >>> IOCTL should >>> just work. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Tue Apr 29 12:04:04 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Apr 2008 20:04:04 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Hi all, The biggest problem that I have seen with lockfiles on Linux At least is, that it seems there is no standard with respect To the folder in which they should be created. Also, many Distributions seem to set up file system permissions in such A way that writing to the lockfile folder is not allowed for The normal user -- that's why we stopped using lockfiles In our commercial product. If we are to still respect lockfiles, we first need to Understand where we are expected to look for them. Does Anybody have any insight what variants of lockfile folder Schema exist out there in the wild? Some apps like minicom Seem to even allow users to manually specify a lockfile Folder of their choice. Because of the difficulty finding the right lockfile folder, And because of the inherent risk of thinking that something Might be locked while it actually isn't, I'd suggest that RXTX should have a "soft-off" feature that allows disabling ALL Lockfile checks at runtime without recompiling the native Sharedlibs. Trent - I like your strategy outline, but I think that it Needs to be configurable by the client such that users and/or Customer Support can disable lockfiles / disable ioctl in Case they detect that they are runing on an OS / Kernal that Does not support one or the other. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Montag, 28. April 2008 12:22 > To: Stephen Davies > Cc: rxtx at qbang.org; Oberhuber, Martin; Trent Jarvi > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > I don't think there would need to be any architectural > changes. A couple > ifdefs and minor changes in the current code should be enough. > > Proposal: > > FHS/UUCP locks: > continue to respect them, try to create them but do not error if > the IOCTL is supported. (But does the IOCTL being defined mean > it will work?) > Enumeration: > Do not assert the IOCTL while opening. > Serial.open: > assert the IOCTL after open. Continue to use locks as described > above after asserting the IOCTL. If the IOCTL is defined but > not working, handle it here. Failure cases include the IOCTL > is not supported and the port is already locked. > > On Mon, 28 Apr 2008, Stephen Davies wrote: > > > Has anybody done any design work on this? > > The first thing that springs to mind is that we still need > to check for lock > > files because other apps tend to use that approach even if > we go to ioctl. > > > > Cheers, > > Stephen Davies > > > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > >> Thanks Trent. > >> > >> Problem is only that I'm really not at all > >> Familiar with the C part of RXTX. If there > >> Were anything I could do in Java for this, > >> It would be easier for me.... > >> > >> ... Are there any C experts here on the list > >> Who'd like to look at ioctl port locking > >> For linux? > >> > >> Thanks, > >> -- > >> Martin Oberhuber, Senior Member of Technical Staff, Wind River > >> Target Management Project Lead, DSDP PMC Member > >> http://www.eclipse.org/dsdp/tm > >> > >>> -----Original Message----- > >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] > >>> Sent: Donnerstag, 24. April 2008 04:32 > >>> To: Oberhuber, Martin > >>> Cc: rxtx at qbang.org > >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? > >>> > >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > >>>> Dear RXTX community, > >>>> > >>>> I'm wondering what the status is with RXTX locking > >>>> serial ports on Linux? > >>>> > >>>> My understanding is that the mechanism used in > >>>> 2.1-7r2 (lockfiles) is not really state of the art, and > >>>> has lots of problems (e.g. missing permissions). > >>>> > >>>> There was an idea to migrate towards a Kernel > >>>> syscall based solution for port locking. > >>>> > >>>> What's the status here? > >>> > >>> Hi Martin, > >>> > >>> I'm in favor of deprecating the current FHS locking mechanism > >>> in favor of > >>> an IOCTL when available. I think it will be available on all the > >>> platforms but do not know for sure. > >>> > >>> The status is unchanged. I've had very few free cycles for > >>> such things. > >>> Feel free to take a stab at it if you have some time. I > >>> believe the IOCTL > >>> is used in the Mac OS X code already. > >>> > >>> I don't see any real backwards compatability issues and the > >>> IOCTL should > >>> just work. > >>> > >>> -- > >>> Trent Jarvi > >>> tjarvi at qbang.org > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > From Steffen.DETTMER at ingenico.com Tue Apr 29 13:34:44 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 29 Apr 2008 21:34:44 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Message-ID: <20080429193444.GU2928@elberon.bln.de.ingenico.com> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > The biggest problem that I have seen with lockfiles on Linux > At least is, that it seems there is no standard with respect > To the folder in which they should be created. Also, many > Distributions seem to set up file system permissions in such > A way that writing to the lockfile folder is not allowed for > The normal user -- that's why we stopped using lockfiles > In our commercial product. It seems it depends on the expectations. I consider it as a feature that by default a linux user cannot access serial ports. Maybe root connected a modem (can produce phone bills) or even some serial card reader, maybe with the web servers key pair. I would expect that by default a user cannot open the serial port because of insufficient permissions on the device file. I would expect this on other unices as well (but I don't know it). For windows I think it should be similar but not impacting so much in practice, because often windows users work with big permissions on a somewhat high priviledge level or even Administrator. > If we are to still respect lockfiles, we first need to > Understand where we are expected to look for them. Does > Anybody have any insight what variants of lockfile folder > Schema exist out there in the wild? Some apps like minicom > Seem to even allow users to manually specify a lockfile > Folder of their choice. At least my (ancient) minicom does not allow the user to change this option, it is displayed but read-only, but root is allowed to change it. > Because of the difficulty finding the right lockfile folder, > And because of the inherent risk of thinking that something > Might be locked while it actually isn't, I'd suggest that > RXTX should have a "soft-off" feature that allows disabling > ALL Lockfile checks at runtime without recompiling the native > Sharedlibs. sounds very reasonable, yes... and as admin I would not wish that users could skip such locking because they do things wrong by default ;) (in the end I guess that is related to the dilemma, that hotplug/user-owned-periphery and multi-user systems simply conflict) > Trent - I like your strategy outline, but I think that it > Needs to be configurable by the client such that users and/or > Customer Support can disable lockfiles / disable ioctl in > Case they detect that they are runing on an OS / Kernal that > Does not support one or the other. Yes, this would be good I guess... Applications could offer configuration options to control that, maybe similarily as minicom. BTW, man minicom tells: *B - Lock file location On most systems This should be /usr/spool/uucp. Linux systems use /var/lock. If this directory does not exist, minicom will not attempt to use lockfiles. The statement `Linux systems use /var/lock' is interesting, does anyone know the source of this convention? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Tue Apr 29 16:11:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Apr 2008 16:11:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? These details are outlined in the Filesystem Hierarchy Standard (FHS). http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLOCKLOCKFILES -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Tue Apr 29 18:58:09 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Wed, 30 Apr 2008 10:28:09 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: <200804301028.09307.scldad@sdc.com.au> I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is the same. Any ideas as to how to handle this? Stephen On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: > * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > > The biggest problem that I have seen with lockfiles on Linux > > At least is, that it seems there is no standard with respect > > To the folder in which they should be created. Also, many > > Distributions seem to set up file system permissions in such > > A way that writing to the lockfile folder is not allowed for > > The normal user -- that's why we stopped using lockfiles > > In our commercial product. > > It seems it depends on the expectations. I consider it as a > feature that by default a linux user cannot access serial ports. > Maybe root connected a modem (can produce phone bills) or even > some serial card reader, maybe with the web servers key pair. > > I would expect that by default a user cannot open the serial port > because of insufficient permissions on the device file. I would > expect this on other unices as well (but I don't know it). > > For windows I think it should be similar but not impacting so > much in practice, because often windows users work with big > permissions on a somewhat high priviledge level or even > Administrator. > > > If we are to still respect lockfiles, we first need to > > Understand where we are expected to look for them. Does > > Anybody have any insight what variants of lockfile folder > > Schema exist out there in the wild? Some apps like minicom > > Seem to even allow users to manually specify a lockfile > > Folder of their choice. > > At least my (ancient) minicom does not allow the user to change > this option, it is displayed but read-only, but root is allowed > to change it. > > > Because of the difficulty finding the right lockfile folder, > > And because of the inherent risk of thinking that something > > Might be locked while it actually isn't, I'd suggest that > > RXTX should have a "soft-off" feature that allows disabling > > ALL Lockfile checks at runtime without recompiling the native > > Sharedlibs. > > sounds very reasonable, yes... > and as admin I would not wish that users could skip such > locking because they do things wrong by default ;) > > (in the end I guess that is related to the dilemma, that > hotplug/user-owned-periphery and multi-user systems simply > conflict) > > > Trent - I like your strategy outline, but I think that it > > Needs to be configurable by the client such that users and/or > > Customer Support can disable lockfiles / disable ioctl in > > Case they detect that they are runing on an OS / Kernal that > > Does not support one or the other. > > Yes, this would be good I guess... Applications could offer > configuration options to control that, maybe similarily as > minicom. > > BTW, man minicom tells: > > *B - Lock file location > On most systems This should be /usr/spool/uucp. > Linux systems use /var/lock. If this directory > does not exist, minicom will not attempt to use > lockfiles. > > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure > and expedient electronic transaction acceptance. Ingenico products leverage > proven technology, established standards and unparalleled ergonomics to > provide optimal reliability, versatility and usability. This comprehensive > range of products is complemented by a global array of services and > partnerships, enabling businesses in a number of vertical sectors to accept > transactions anywhere their business takes them. www.ingenico.com This > message may contain confidential and/or privileged information. If you are > not the addressee or authorized to receive this for the addressee, you must > not use, copy, disclose or take any action based on this message or any > information herein. If you have received this message in error, please > advise the sender immediately by reply e-mail and delete this message. > Thank you for your cooperation. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Wed Apr 30 19:30:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 30 Apr 2008 19:30:51 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804301028.09307.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> <200804301028.09307.scldad@sdc.com.au> Message-ID: Hi Stephen, I suspect ioctl/TIOCEXCL open/O_EXCL would do the job. Mac uses TIOCEXCL and it is POSIX. We use O_EXCL for lockfiles on Linux already. On Wed, 30 Apr 2008, Stephen Davies wrote: > I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is > the same. > > Any ideas as to how to handle this? > > Stephen > > > On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: >> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: >>> The biggest problem that I have seen with lockfiles on Linux >>> At least is, that it seems there is no standard with respect >>> To the folder in which they should be created. Also, many >>> Distributions seem to set up file system permissions in such >>> A way that writing to the lockfile folder is not allowed for >>> The normal user -- that's why we stopped using lockfiles >>> In our commercial product. >> >> It seems it depends on the expectations. I consider it as a >> feature that by default a linux user cannot access serial ports. >> Maybe root connected a modem (can produce phone bills) or even >> some serial card reader, maybe with the web servers key pair. >> >> I would expect that by default a user cannot open the serial port >> because of insufficient permissions on the device file. I would >> expect this on other unices as well (but I don't know it). >> >> For windows I think it should be similar but not impacting so >> much in practice, because often windows users work with big >> permissions on a somewhat high priviledge level or even >> Administrator. >> >>> If we are to still respect lockfiles, we first need to >>> Understand where we are expected to look for them. Does >>> Anybody have any insight what variants of lockfile folder >>> Schema exist out there in the wild? Some apps like minicom >>> Seem to even allow users to manually specify a lockfile >>> Folder of their choice. >> >> At least my (ancient) minicom does not allow the user to change >> this option, it is displayed but read-only, but root is allowed >> to change it. >> >>> Because of the difficulty finding the right lockfile folder, >>> And because of the inherent risk of thinking that something >>> Might be locked while it actually isn't, I'd suggest that >>> RXTX should have a "soft-off" feature that allows disabling >>> ALL Lockfile checks at runtime without recompiling the native >>> Sharedlibs. >> >> sounds very reasonable, yes... >> and as admin I would not wish that users could skip such >> locking because they do things wrong by default ;) >> >> (in the end I guess that is related to the dilemma, that >> hotplug/user-owned-periphery and multi-user systems simply >> conflict) >> >>> Trent - I like your strategy outline, but I think that it >>> Needs to be configurable by the client such that users and/or >>> Customer Support can disable lockfiles / disable ioctl in >>> Case they detect that they are runing on an OS / Kernal that >>> Does not support one or the other. >> >> Yes, this would be good I guess... Applications could offer >> configuration options to control that, maybe similarily as >> minicom. >> >> BTW, man minicom tells: >> >> *B - Lock file location >> On most systems This should be /usr/spool/uucp. >> Linux systems use /var/lock. If this directory >> does not exist, minicom will not attempt to use >> lockfiles. >> >> The statement `Linux systems use /var/lock' is interesting, does >> anyone know the source of this convention? >> >> oki, >> >> Steffen >> >> About Ingenico Throughout the world businesses rely on Ingenico for secure >> and expedient electronic transaction acceptance. Ingenico products leverage >> proven technology, established standards and unparalleled ergonomics to >> provide optimal reliability, versatility and usability. This comprehensive >> range of products is complemented by a global array of services and >> partnerships, enabling businesses in a number of vertical sectors to accept >> transactions anywhere their business takes them. www.ingenico.com This >> message may contain confidential and/or privileged information. If you are >> not the addressee or authorized to receive this for the addressee, you must >> not use, copy, disclose or take any action based on this message or any >> information herein. If you have received this message in error, please >> advise the sender immediately by reply e-mail and delete this message. >> Thank you for your cooperation. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0055.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0053.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0040.html From pboulton at pulsetracer.com Fri Apr 18 14:30:13 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Fri, 18 Apr 2008 13:30:13 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site Message-ID: <480904D5.1060307@pulsetracer.com> Hello, gentle serial porters. I have downloaded the zipped up binaries for use on Windows without Sun's CommAPI, but don't seem able to extract anything from the download. Go to main page, http://www.rxtx.org/ Click on Downloads I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) And I save it to disk. If I try and extract the files with WinZip, Winzip thinks the archive is corrupt. If I try using Windows Explorer, I am able to extract it into a single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than the original .zip. Any help would be much appreciated. Sincerely, Philip Boulton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080418/97d89793/attachment-0038.html From tjarvi at qbang.org Fri Apr 18 19:07:00 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 18 Apr 2008 19:07:00 -0600 (MDT) Subject: [Rxtx] Difficulty opening zip file at rxtx site In-Reply-To: <480904D5.1060307@pulsetracer.com> References: <480904D5.1060307@pulsetracer.com> Message-ID: On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org From pboulton at pulsetracer.com Sat Apr 19 12:46:26 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Sat, 19 Apr 2008 11:46:26 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site References: <480904D5.1060307@pulsetracer.com> Message-ID: <53DB7576450695419E09299104043761A78533@ZTGSERVER.ztg.local> I have been able to get my hands on the binaries, by going to the ftp directory /pub/rxtx at ftp.qbang.org,, and ftping the file rxtx-2.1-7-bins-r2.zip . This opens happily with Winzip, and extracts as the set of files that you describe below. I only experience the ill-formed archive problem by clicking the link on the rxtx.org Downloads page (http://rxtx.qbang.org/pub/rxtx/ rxtx-2.1-7-bins-r2.zip ). Not sure what to make of that. Philip Boulton ________________________________ From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Fri 4/18/2008 6:07 PM To: Philip Boulton Cc: rxtx at qbang.org Subject: Re: [Rxtx] Difficulty opening zip file at rxtx site On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080419/147923bb/attachment-0037.html From jlar310 at gmail.com Sat Apr 19 19:11:55 2008 From: jlar310 at gmail.com (Jeff Larsen) Date: Sat, 19 Apr 2008 20:11:55 -0500 Subject: [Rxtx] Moxa serial over Ethernet driver Message-ID: Hi all, I've been using javax.comm for years to communicate with a legacy radio data system. We want to migrate the java side of the system to a VMware Server virtual machine. We've had great success using Moxa DE-303 and 5610 serial over Ethernet appliances and virtual machines for running hylafax. The OS (Linux in this case) uses a kernel driver to communicate with the Moxa via a virtual serial port such as /dev/ttyr00. I want to do the same thing with javax.comm or gnu.io to connect to a virtual serial port. However I'm hitting road blocks everywhere. javax.comm for Linux sees the virtual port, but there are transmission errors. Tried Solaris too, but the Solaris Moxa drivers don't play nice with javax.comm because the driver uses /dev/pts/n instead of /dev/term/x. Next I tried RXTX on Linux, but I'm getting NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX on Solaris. Has anyone used RXTX with serial over Ethernet devices? Any hints on how to make it work? I know that I'm not completely off track because javax.comm does work with Moxa on a Windows platform, but that's just not an option for production deployment. -- Jeff From tjarvi at qbang.org Sat Apr 19 21:08:41 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 19 Apr 2008 21:08:41 -0600 (MDT) Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: yOn Sat, 19 Apr 2008, Jeff Larsen wrote: > Hi all, > > I've been using javax.comm for years to communicate with a legacy > radio data system. We want to migrate the java side of the system to a > VMware Server virtual machine. We've had great success using Moxa > DE-303 and 5610 serial over Ethernet appliances and virtual machines > for running hylafax. The OS (Linux in this case) uses a kernel driver > to communicate with the Moxa via a virtual serial port such as > /dev/ttyr00. > > I want to do the same thing with javax.comm or gnu.io to connect to a > virtual serial port. However I'm hitting road blocks everywhere. > javax.comm for Linux sees the virtual port, but there are transmission > errors. Tried Solaris too, but the Solaris Moxa drivers don't play > nice with javax.comm because the driver uses /dev/pts/n instead of > /dev/term/x. Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris. > > Has anyone used RXTX with serial over Ethernet devices? Any hints on > how to make it work? > > I know that I'm not completely off track because javax.comm does work > with Moxa on a Windows platform, but that's just not an option for > production deployment. > > Moxa should work under linux. There may be minor issues depending upon how complete the kernel driver is but I think it will work. One of the minor issues is /dev/ttyr00 is not enumerated. There are several work arounds documented with the source code and on the wiki. The easiest solution for testing purposes is to make a symbolic link from /dev/ttyr00 to a port that is enumerated such as /dev/ttyS129. You can later alter the rxtx source or use properties to change the enumerated ports. -- Trent Jarvi tjarvi at qbang.org From d.tonhofer at m-plify.com Sun Apr 20 03:33:30 2008 From: d.tonhofer at m-plify.com (David Tonhofer (M-PLIFY S.A.)) Date: Sun, 20 Apr 2008 11:33:30 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: <480B0DEA.5010908@m-plify.com> Jeff Larsen wrote: > Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris It might be that the Java side of RXTX does not recognize that portname. Trying modifying src/RXTXCommDriver.java as described in this case: http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card From ajmas at sympatico.ca Sun Apr 20 16:37:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Apr 2008 18:37:59 -0400 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <480B0DEA.5010908@m-plify.com> References: <480B0DEA.5010908@m-plify.com> Message-ID: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > Jeff Larsen wrote: >> Next I tried RXTX on Linux, but I'm getting >> NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX >> on Solaris > It might be that the Java side of RXTX does not recognize that > portname. > Trying modifying src/RXTXCommDriver.java as described in this case: > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card I wonder whether it would be worth allowing custom port prefixes as a system parameter? For example: gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" Andre From Martin.Oberhuber at windriver.com Tue Apr 22 12:34:36 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 22 Apr 2008 20:34:36 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> References: <480B0DEA.5010908@m-plify.com> <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE6485848056CD6CE@ism-mail03.corp.ad.wrs.com> Sounds like a great idea... I'm wondering how the "variable part" after the Prefixes could be specified though? What about allowing Regular Expression character Classes in the existing System Property for specifying ports: System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyS[0-9],ttyS[ABC],ttyUSB[0-9a-z]"); The set of allowed patterns would of course need to Be restricted compared to REGEX, because it must be A syntax that supports iterating over it. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Montag, 21. April 2008 00:38 > To: rxtx at qbang.org and Users > Subject: Re: [Rxtx] Moxa serial over Ethernet driver > > > On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > > Jeff Larsen wrote: > >> Next I tried RXTX on Linux, but I'm getting > >> NoSuchPortException connecting to /dev/ttyr00. I have yet > to try RXTX > >> on Solaris > > It might be that the Java side of RXTX does not recognize that > > portname. > > Trying modifying src/RXTXCommDriver.java as described in this case: > > > > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_ > SST-4P.2FLP_multiport_card > > I wonder whether it would be worth allowing custom port > prefixes as a > system parameter? For > example: > > gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Loi.TRAN at weatherford.com Tue Apr 22 13:10:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Tue, 22 Apr 2008 14:10:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled Message-ID: Hi, I'm currently using the Java RXTX API to interface to a serial port. The serial port is connected to a bridge board that communicates with our communications system running at 1.875 Mbps which is linked to an embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no flow control). I send a command to the embedded board through the serial-bridge board which then is relayed to the embedded board. The command sent asks the embedded board to dump a binary image. Here's where I'm hitting some problems. I've successfully done this is an integrated serial port from the laptop. The binary file that comes back is consistent on every attempt. When I use the application I've written to do the same thing with a USB-to-serial adapter, the image I get back is not the same as the image I receive through the USB-to-serial adapter is not consistent at all. A final thing is that when I use a terminal program to dump the binary image with the USB-serial adapter, the image is correct. Every time! What is the terminal program doing that's not being done in my application? My application is quite simple. Has anyone observed this behavior before? If you have, I'd like to know how you've gotten around this problem. Thanks, LT =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From tjarvi at qbang.org Tue Apr 22 21:11:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 22 Apr 2008 21:11:10 -0600 (MDT) Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org From Loi.TRAN at weatherford.com Wed Apr 23 08:35:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Wed, 23 Apr 2008 09:35:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: Thanks for all the responses. I finally tried something that worked consistently. I updated my Prolific driver and repeated my tests. It worked. If you're using the Prolific type USB-serial adapters, do no use the Prolific version 2.0.2.1 driver on Windows. Update it to the latest 2.0.2.8 version. Again, thanks for all the responses. LT -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Tuesday, April 22, 2008 10:11 PM To: TRAN, Loi X. Cc: rxtx at qbang.org Subject: Re: [Rxtx] Prolific USB - RXTX data mangled On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From Martin.Oberhuber at windriver.com Wed Apr 23 18:54:26 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 02:54:26 +0200 Subject: [Rxtx] RXTX port locking on Linux status? Message-ID: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Dear RXTX community, I'm wondering what the status is with RXTX locking serial ports on Linux? My understanding is that the mechanism used in 2.1-7r2 (lockfiles) is not really state of the art, and has lots of problems (e.g. missing permissions). There was an idea to migrate towards a Kernel syscall based solution for port locking. What's the status here? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/9878db9f/attachment-0033.html From tjarvi at qbang.org Wed Apr 23 20:32:24 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Apr 2008 20:32:24 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > Dear RXTX community, > > I'm wondering what the status is with RXTX locking > serial ports on Linux? > > My understanding is that the mechanism used in > 2.1-7r2 (lockfiles) is not really state of the art, and > has lots of problems (e.g. missing permissions). > > There was an idea to migrate towards a Kernel > syscall based solution for port locking. > > What's the status here? > Hi Martin, I'm in favor of deprecating the current FHS locking mechanism in favor of an IOCTL when available. I think it will be available on all the platforms but do not know for sure. The status is unchanged. I've had very few free cycles for such things. Feel free to take a stab at it if you have some time. I believe the IOCTL is used in the Mac OS X code already. I don't see any real backwards compatability issues and the IOCTL should just work. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Apr 24 06:14:06 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 14:14:06 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Thanks Trent. Problem is only that I'm really not at all Familiar with the C part of RXTX. If there Were anything I could do in Java for this, It would be easier for me.... ... Are there any C experts here on the list Who'd like to look at ioctl port locking For linux? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Donnerstag, 24. April 2008 04:32 > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > I'm wondering what the status is with RXTX locking > > serial ports on Linux? > > > > My understanding is that the mechanism used in > > 2.1-7r2 (lockfiles) is not really state of the art, and > > has lots of problems (e.g. missing permissions). > > > > There was an idea to migrate towards a Kernel > > syscall based solution for port locking. > > > > What's the status here? > > > > Hi Martin, > > I'm in favor of deprecating the current FHS locking mechanism > in favor of > an IOCTL when available. I think it will be available on all the > platforms but do not know for sure. > > The status is unchanged. I've had very few free cycles for > such things. > Feel free to take a stab at it if you have some time. I > believe the IOCTL > is used in the Mac OS X code already. > > I don't see any real backwards compatability issues and the > IOCTL should > just work. > > -- > Trent Jarvi > tjarvi at qbang.org > From sspies at sloc.de Thu Apr 24 07:15:36 2008 From: sspies at sloc.de (Sebastian Spies) Date: Thu, 24 Apr 2008 15:15:36 +0200 (CEST) Subject: [Rxtx] rxtx on gumstix: Interrupted system call In-Reply-To: <47FB7B20.7080504@sloc.de> References: <47FB7B20.7080504@sloc.de> Message-ID: <55445.130.83.139.205.1209042936.squirrel@ssl.sloc.de> Dear list, while porting rxtx to the gumstix, I found out, that select used in readArray in SerialImp.c might not work as expected. Maybe, because of missing TIOCSERGETLSR-support? select is often interrupted, so i wrote the following quick'n'dirty hack to make it work on gumstix: diff -Nur rxtx-2.1-7r2/src/SerialImp.c rxtx-2.1-7r2/src/SerialImp.c --- rxtx-2.1-7r2/src/SerialImp.c 2006-01-29 23:19:04.000000000 +0100 +++ rxtx-2.1-7r2-patched/src/SerialImp.c 2008-04-24 14:30:17.000000000 +0200 @@ -3380,7 +3381,7 @@ JNIEXPORT jint JNICALL RXTXPort(readArray)( JNIEnv *env, jobject jobj, jbyteArray jbarray, jint offset, jint length ) { - int bytes; + int bytes = 0; jbyte *body; /* char msg[80]; */ int fd = get_java_var( env, jobj, "fd", "I" ); @@ -3397,9 +3398,18 @@ "readArray", "Invalid length" ); return -1; } - body = (*env)->GetByteArrayElements( env, jbarray, 0 ); - bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ - (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + while(1 > bytes) + { + body = (*env)->GetByteArrayElements( env, jbarray, 0 ); + bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ + (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + // quick'n'dirty - SSP + report (" trying again... \n"); + errno = 0; + } + if( bytes < 0 ) { report( "RXTXPort:readArray bytes < 0" ); LEAVE( "RXTXPort:readArray" ); > Hey, > > I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use > RXTXPort$SerialInputStream.read(), then I get the following Exception. I > did not yet figure out which system call is interrupted as strace > produces loads of output. > > Any help would be very appreciated. Thanks in advance. > Sebastian > > > [java] java.io.IOException: Interrupted system call in readArray > [java] at gnu.io.RXTXPort.readArray(Native Method) > [java] at > gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) > [java] at > java.io.FilterInputStream.read(FilterInputStream.java:189) > [java] at > java.io.BufferedInputStream.refill(BufferedInputStream.java:371) > [java] at > java.io.BufferedInputStream.read(BufferedInputStream.java:229) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) > [java] at > com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) > > -- > Sebastian Spies > > mail: sspies at sloc.de > > > > From fire_baptized at hotmail.com Thu Apr 24 18:27:48 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Thu, 24 Apr 2008 20:27:48 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hello I am having a problem with the serial device connecting (software wise) to the serial port. However I have a test program and it seems to work just fine in that environment - and it doesnt use GUI. The error I am getting is : PortNotFoundException Now the way I have it setup in the GUI environment is that once the user pushes a JButton the program connects using this class: protected void establishConnection() { try { portId = CommPortIdentifier.getPortIdentifier("COM3"); System.out.println("Establishing connction....."); messages[0] = "\nEstablishing connction.....\n"; } catch ( NoSuchPortException noport) { System.out.println("Port not found: "+ noport); messages[0] = "Port not found: "+ noport+"\n"; } try { serialPort = (SerialPort) portId.open("serial", 50); System.out.println("Port has been found."); messages[1] = "Port has been found.\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[1] = "" +usedport; } try { serialPort = (SerialPort) portId.open("serial", 50); messages[2] = "Connecting to COM3 on port 50....\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; } try { serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); System.out.println("Esablishing the transfer rate settings for COM3."); messages[3] = "Esablishing the transfer rate settings for COM3.\n"; } catch (UnsupportedCommOperationException nosupcom) { System.out.println(nosupcom); System.out.println("The tranfer rate could not be esblished on COM3."); messages[3] = "The tranfer rate could not be esblished on COM3.\n"; } System.out.println(serialPort.getFlowControlMode()); messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; //sendDataOut(buffer[3],buffer[4]); } I need all the data in this method (and all the string values in this method) to be printed out on a JTextArea. I wont do me any good if not all the text is printed on a JTextArea in another class. So I have the text printing the JTextArea correctly, but everytime the JButton is activated - it gives me that error message. I did add a disconnect button that is supposed to call the serialPort.close(). _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/273fd4ec/attachment-0032.html From tjarvi at qbang.org Thu Apr 24 21:54:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Apr 2008 21:54:10 -0600 (MDT) Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > Hello I am having a problem with the serial device connecting (software > wise) to the serial port. However I have a test program and it seems to > work just fine in that environment - and it doesnt use GUI. The error I > am getting is : PortNotFoundException Now the way I have it setup in the > GUI environment is that once the user pushes a JButton the program > connects using this class: > > protected void establishConnection() { > try { > portId = CommPortIdentifier.getPortIdentifier("COM3"); > System.out.println("Establishing connction....."); > messages[0] = "\nEstablishing connction.....\n"; > } > catch ( NoSuchPortException noport) { > System.out.println("Port not found: "+ noport); > messages[0] = "Port not found: "+ noport+"\n"; > } > try { > serialPort = (SerialPort) portId.open("serial", 50); > System.out.println("Port has been found."); > messages[1] = "Port has been found.\n"; > } > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[1] = "" +usedport; > } ================================================================= > try { > serialPort = (SerialPort) portId.open("serial", 50); > messages[2] = "Connecting to COM3 on port 50....\n"; > } ================================================================== > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > } > try { > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > System.out.println("Esablishing the transfer rate settings for COM3."); > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > } > catch (UnsupportedCommOperationException nosupcom) { > System.out.println(nosupcom); > System.out.println("The tranfer rate could not be esblished on COM3."); > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > } > System.out.println(serialPort.getFlowControlMode()); > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > //sendDataOut(buffer[3],buffer[4]); > } > > I need all the data in this method (and all the string values in this > method) to be printed out on a JTextArea. I wont do me any good if not > all the text is printed on a JTextArea in another class. So I have the > text printing the JTextArea correctly, but everytime the JButton is > activated - it gives me that error message. I did add a disconnect > button that is supposed to call the serialPort.close(). > The open code used twice is going to throw an exception. It may be that you catch the exception above this code and print a confusing message? A common mistake is people will accidently run two copies of their program. The first instance of the program will open the port and prevent enumeration (finding the port) in the second instance of the program. As an example, you may be running your text based application which is preventing the GUI from seeing the port. Enumeration is done by trying to open the port. If the port is open, Enumeration fails. -- Trent Jarvi tjarvi at qbang.org From fire_baptized at hotmail.com Thu Apr 24 22:32:05 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 00:32:05 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Wow - thanks dude what a dumb thing for me to not catch..... now here is the current problem - right now I am trying to output data again one is with the test program - and it seems that serialPort.setRTS(true); is throwing an exceptions there - now if I show this code please bare in mind that I am only testing - the code is kinda sloppy in my mind - but if I can figure out why calling this function is throwing an exception then maybe I can figure out why my GUI application is getting the same null pointer exceptions when try to send out the data stream. FYI Trent this email is not directed towards you - anyone can jump in on this public static void main(String args[]) { byte[] b = new byte[64]; int keyinput = 0 ; byte x = 0; byte y = 0; PortTesting1 testports = new PortTesting1(); try { joyskoro = Joystick.createInstance(); } catch (IOException ioexc) { System.out.println("There is an input/output problem: " + ioexc); } while (true) { joyskoro.poll(); b[0] = ((byte) -(10 * joyskoro.getY())); b[1] = ((byte) (10 * joyskoro.getX())); System.out.println("The 3rd byte is: " +b[0]); System.out.println("The 4rd byte is: " +b[1]); serialPort.setRTS(true); // HERE IS WHERE THE PROBLEM IS !!!!!!! ON THIS LINE but if I dont have it active in my program the Bluetooth device (that is System.out.println("Ready to send :-) !"); //connected to the serial port does not send out data!!!!! if (joyskoro.isButtonDown(joyskoro.BUTTON10)) { System.out.println("Connection terminated."); serialPort.close(); break; } if (joyskoro.isButtonDown(joyskoro.BUTTON2)) { boolean flag = true; //reading from key input from the keyboard System.out.println("Please input a command: "); while (flag) { try { keyinput = System.in.read(); } catch (IOException ioexc) {/*there is no need to put * anything here */ } if((char)keyinput=='w') { pushIt((byte)85); } if((char)keyinput=='s') { pushIt((byte)84); } if((char)keyinput=='a') { pushIt((byte)83); } if((char)keyinput=='d') { pushIt((byte)82); } if((char)keyinput=='q') { pushIt((byte)89); } if((char)keyinput=='\t') { //this stop reading input from the keyboard flag = false; } } and help anyways here is the block of code that throwing an exception for the test program: > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/5c8f7d68/attachment-0032.html From fire_baptized at hotmail.com Fri Apr 25 07:59:53 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 09:59:53 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Are there any examples of how to push out data? As in using input and output streams - if I can compare code maybe I can see where this is causing a problem. I have a byte array that I am pushing out data. I keep getting null pointer exceptions every where I turn. > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/22228ab6/attachment-0031.html From ajmas at sympatico.ca Sat Apr 26 07:37:09 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 26 Apr 2008 09:37:09 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hi, On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote: > > Are there any examples of how to push out data? As in using input > and output streams - if I can compare code maybe I can see where > this is causing a problem. I have a byte array that I am pushing > out data. I keep getting null pointer exceptions every where I turn. > There are some examples here that might be of help: http://rxtx.qbang.org/wiki/index.php/Examples Andre From fire_baptized at hotmail.com Sat Apr 26 20:13:54 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Sat, 26 Apr 2008 22:13:54 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: looked at those....yep didnt help - I need to push out data with GUI and not get a null pointer exception everytime I try. > CC: rxtx at qbang.org> From: ajmas at sympatico.ca> To: fire_baptized at hotmail.com> Subject: Re: [Rxtx] Serial Problems with Gui.....> Date: Sat, 26 Apr 2008 09:37:09 -0400> > Hi,> > > On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote:> >> > Are there any examples of how to push out data? As in using input > > and output streams - if I can compare code maybe I can see where > > this is causing a problem. I have a byte array that I am pushing > > out data. I keep getting null pointer exceptions every where I turn.> >> > There are some examples here that might be of help:> > http://rxtx.qbang.org/wiki/index.php/Examples> > Andre _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080426/09f95b41/attachment-0030.html From michael.erskine at ketech.com Mon Apr 28 02:47:22 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 28 Apr 2008 09:47:22 +0100 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D426EF3CBBC5@no-sv-03.ketech.local> Jesrael D. Summerhill wrote: > looked at those....yep didnt help - I need to push out data with GUI and > not get a null pointer exception everytime I try. So it seems pretty obvious that your code needs to check for nulls wherever one may occur and report what's happening. Alternatively, catch the npe and display the stack trace. Then you can fix your code so it doesn't try to work with something that ain't there. Regards, Michael Erskine. From scldad at sdc.com.au Mon Apr 28 03:58:34 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Mon, 28 Apr 2008 19:28:34 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Message-ID: <200804281928.34454.scldad@sdc.com.au> Has anybody done any design work on this? The first thing that springs to mind is that we still need to check for lock files because other apps tend to use that approach even if we go to ioctl. Cheers, Stephen Davies On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > Thanks Trent. > > Problem is only that I'm really not at all > Familiar with the C part of RXTX. If there > Were anything I could do in Java for this, > It would be easier for me.... > > ... Are there any C experts here on the list > Who'd like to look at ioctl port locking > For linux? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > -----Original Message----- > > From: Trent Jarvi [mailto:tjarvi at qbang.org] > > Sent: Donnerstag, 24. April 2008 04:32 > > To: Oberhuber, Martin > > Cc: rxtx at qbang.org > > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > > > I'm wondering what the status is with RXTX locking > > > serial ports on Linux? > > > > > > My understanding is that the mechanism used in > > > 2.1-7r2 (lockfiles) is not really state of the art, and > > > has lots of problems (e.g. missing permissions). > > > > > > There was an idea to migrate towards a Kernel > > > syscall based solution for port locking. > > > > > > What's the status here? > > > > Hi Martin, > > > > I'm in favor of deprecating the current FHS locking mechanism > > in favor of > > an IOCTL when available. I think it will be available on all the > > platforms but do not know for sure. > > > > The status is unchanged. I've had very few free cycles for > > such things. > > Feel free to take a stab at it if you have some time. I > > believe the IOCTL > > is used in the Mac OS X code already. > > > > I don't see any real backwards compatability issues and the > > IOCTL should > > just work. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Mon Apr 28 04:21:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 28 Apr 2008 04:21:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804281928.34454.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: I don't think there would need to be any architectural changes. A couple ifdefs and minor changes in the current code should be enough. Proposal: FHS/UUCP locks: continue to respect them, try to create them but do not error if the IOCTL is supported. (But does the IOCTL being defined mean it will work?) Enumeration: Do not assert the IOCTL while opening. Serial.open: assert the IOCTL after open. Continue to use locks as described above after asserting the IOCTL. If the IOCTL is defined but not working, handle it here. Failure cases include the IOCTL is not supported and the port is already locked. On Mon, 28 Apr 2008, Stephen Davies wrote: > Has anybody done any design work on this? > The first thing that springs to mind is that we still need to check for lock > files because other apps tend to use that approach even if we go to ioctl. > > Cheers, > Stephen Davies > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: >> Thanks Trent. >> >> Problem is only that I'm really not at all >> Familiar with the C part of RXTX. If there >> Were anything I could do in Java for this, >> It would be easier for me.... >> >> ... Are there any C experts here on the list >> Who'd like to look at ioctl port locking >> For linux? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >>> -----Original Message----- >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] >>> Sent: Donnerstag, 24. April 2008 04:32 >>> To: Oberhuber, Martin >>> Cc: rxtx at qbang.org >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? >>> >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: >>>> Dear RXTX community, >>>> >>>> I'm wondering what the status is with RXTX locking >>>> serial ports on Linux? >>>> >>>> My understanding is that the mechanism used in >>>> 2.1-7r2 (lockfiles) is not really state of the art, and >>>> has lots of problems (e.g. missing permissions). >>>> >>>> There was an idea to migrate towards a Kernel >>>> syscall based solution for port locking. >>>> >>>> What's the status here? >>> >>> Hi Martin, >>> >>> I'm in favor of deprecating the current FHS locking mechanism >>> in favor of >>> an IOCTL when available. I think it will be available on all the >>> platforms but do not know for sure. >>> >>> The status is unchanged. I've had very few free cycles for >>> such things. >>> Feel free to take a stab at it if you have some time. I >>> believe the IOCTL >>> is used in the Mac OS X code already. >>> >>> I don't see any real backwards compatability issues and the >>> IOCTL should >>> just work. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Tue Apr 29 12:04:04 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Apr 2008 20:04:04 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Hi all, The biggest problem that I have seen with lockfiles on Linux At least is, that it seems there is no standard with respect To the folder in which they should be created. Also, many Distributions seem to set up file system permissions in such A way that writing to the lockfile folder is not allowed for The normal user -- that's why we stopped using lockfiles In our commercial product. If we are to still respect lockfiles, we first need to Understand where we are expected to look for them. Does Anybody have any insight what variants of lockfile folder Schema exist out there in the wild? Some apps like minicom Seem to even allow users to manually specify a lockfile Folder of their choice. Because of the difficulty finding the right lockfile folder, And because of the inherent risk of thinking that something Might be locked while it actually isn't, I'd suggest that RXTX should have a "soft-off" feature that allows disabling ALL Lockfile checks at runtime without recompiling the native Sharedlibs. Trent - I like your strategy outline, but I think that it Needs to be configurable by the client such that users and/or Customer Support can disable lockfiles / disable ioctl in Case they detect that they are runing on an OS / Kernal that Does not support one or the other. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Montag, 28. April 2008 12:22 > To: Stephen Davies > Cc: rxtx at qbang.org; Oberhuber, Martin; Trent Jarvi > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > I don't think there would need to be any architectural > changes. A couple > ifdefs and minor changes in the current code should be enough. > > Proposal: > > FHS/UUCP locks: > continue to respect them, try to create them but do not error if > the IOCTL is supported. (But does the IOCTL being defined mean > it will work?) > Enumeration: > Do not assert the IOCTL while opening. > Serial.open: > assert the IOCTL after open. Continue to use locks as described > above after asserting the IOCTL. If the IOCTL is defined but > not working, handle it here. Failure cases include the IOCTL > is not supported and the port is already locked. > > On Mon, 28 Apr 2008, Stephen Davies wrote: > > > Has anybody done any design work on this? > > The first thing that springs to mind is that we still need > to check for lock > > files because other apps tend to use that approach even if > we go to ioctl. > > > > Cheers, > > Stephen Davies > > > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > >> Thanks Trent. > >> > >> Problem is only that I'm really not at all > >> Familiar with the C part of RXTX. If there > >> Were anything I could do in Java for this, > >> It would be easier for me.... > >> > >> ... Are there any C experts here on the list > >> Who'd like to look at ioctl port locking > >> For linux? > >> > >> Thanks, > >> -- > >> Martin Oberhuber, Senior Member of Technical Staff, Wind River > >> Target Management Project Lead, DSDP PMC Member > >> http://www.eclipse.org/dsdp/tm > >> > >>> -----Original Message----- > >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] > >>> Sent: Donnerstag, 24. April 2008 04:32 > >>> To: Oberhuber, Martin > >>> Cc: rxtx at qbang.org > >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? > >>> > >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > >>>> Dear RXTX community, > >>>> > >>>> I'm wondering what the status is with RXTX locking > >>>> serial ports on Linux? > >>>> > >>>> My understanding is that the mechanism used in > >>>> 2.1-7r2 (lockfiles) is not really state of the art, and > >>>> has lots of problems (e.g. missing permissions). > >>>> > >>>> There was an idea to migrate towards a Kernel > >>>> syscall based solution for port locking. > >>>> > >>>> What's the status here? > >>> > >>> Hi Martin, > >>> > >>> I'm in favor of deprecating the current FHS locking mechanism > >>> in favor of > >>> an IOCTL when available. I think it will be available on all the > >>> platforms but do not know for sure. > >>> > >>> The status is unchanged. I've had very few free cycles for > >>> such things. > >>> Feel free to take a stab at it if you have some time. I > >>> believe the IOCTL > >>> is used in the Mac OS X code already. > >>> > >>> I don't see any real backwards compatability issues and the > >>> IOCTL should > >>> just work. > >>> > >>> -- > >>> Trent Jarvi > >>> tjarvi at qbang.org > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > From Steffen.DETTMER at ingenico.com Tue Apr 29 13:34:44 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 29 Apr 2008 21:34:44 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Message-ID: <20080429193444.GU2928@elberon.bln.de.ingenico.com> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > The biggest problem that I have seen with lockfiles on Linux > At least is, that it seems there is no standard with respect > To the folder in which they should be created. Also, many > Distributions seem to set up file system permissions in such > A way that writing to the lockfile folder is not allowed for > The normal user -- that's why we stopped using lockfiles > In our commercial product. It seems it depends on the expectations. I consider it as a feature that by default a linux user cannot access serial ports. Maybe root connected a modem (can produce phone bills) or even some serial card reader, maybe with the web servers key pair. I would expect that by default a user cannot open the serial port because of insufficient permissions on the device file. I would expect this on other unices as well (but I don't know it). For windows I think it should be similar but not impacting so much in practice, because often windows users work with big permissions on a somewhat high priviledge level or even Administrator. > If we are to still respect lockfiles, we first need to > Understand where we are expected to look for them. Does > Anybody have any insight what variants of lockfile folder > Schema exist out there in the wild? Some apps like minicom > Seem to even allow users to manually specify a lockfile > Folder of their choice. At least my (ancient) minicom does not allow the user to change this option, it is displayed but read-only, but root is allowed to change it. > Because of the difficulty finding the right lockfile folder, > And because of the inherent risk of thinking that something > Might be locked while it actually isn't, I'd suggest that > RXTX should have a "soft-off" feature that allows disabling > ALL Lockfile checks at runtime without recompiling the native > Sharedlibs. sounds very reasonable, yes... and as admin I would not wish that users could skip such locking because they do things wrong by default ;) (in the end I guess that is related to the dilemma, that hotplug/user-owned-periphery and multi-user systems simply conflict) > Trent - I like your strategy outline, but I think that it > Needs to be configurable by the client such that users and/or > Customer Support can disable lockfiles / disable ioctl in > Case they detect that they are runing on an OS / Kernal that > Does not support one or the other. Yes, this would be good I guess... Applications could offer configuration options to control that, maybe similarily as minicom. BTW, man minicom tells: *B - Lock file location On most systems This should be /usr/spool/uucp. Linux systems use /var/lock. If this directory does not exist, minicom will not attempt to use lockfiles. The statement `Linux systems use /var/lock' is interesting, does anyone know the source of this convention? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Tue Apr 29 16:11:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Apr 2008 16:11:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? These details are outlined in the Filesystem Hierarchy Standard (FHS). http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLOCKLOCKFILES -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Tue Apr 29 18:58:09 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Wed, 30 Apr 2008 10:28:09 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: <200804301028.09307.scldad@sdc.com.au> I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is the same. Any ideas as to how to handle this? Stephen On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: > * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > > The biggest problem that I have seen with lockfiles on Linux > > At least is, that it seems there is no standard with respect > > To the folder in which they should be created. Also, many > > Distributions seem to set up file system permissions in such > > A way that writing to the lockfile folder is not allowed for > > The normal user -- that's why we stopped using lockfiles > > In our commercial product. > > It seems it depends on the expectations. I consider it as a > feature that by default a linux user cannot access serial ports. > Maybe root connected a modem (can produce phone bills) or even > some serial card reader, maybe with the web servers key pair. > > I would expect that by default a user cannot open the serial port > because of insufficient permissions on the device file. I would > expect this on other unices as well (but I don't know it). > > For windows I think it should be similar but not impacting so > much in practice, because often windows users work with big > permissions on a somewhat high priviledge level or even > Administrator. > > > If we are to still respect lockfiles, we first need to > > Understand where we are expected to look for them. Does > > Anybody have any insight what variants of lockfile folder > > Schema exist out there in the wild? Some apps like minicom > > Seem to even allow users to manually specify a lockfile > > Folder of their choice. > > At least my (ancient) minicom does not allow the user to change > this option, it is displayed but read-only, but root is allowed > to change it. > > > Because of the difficulty finding the right lockfile folder, > > And because of the inherent risk of thinking that something > > Might be locked while it actually isn't, I'd suggest that > > RXTX should have a "soft-off" feature that allows disabling > > ALL Lockfile checks at runtime without recompiling the native > > Sharedlibs. > > sounds very reasonable, yes... > and as admin I would not wish that users could skip such > locking because they do things wrong by default ;) > > (in the end I guess that is related to the dilemma, that > hotplug/user-owned-periphery and multi-user systems simply > conflict) > > > Trent - I like your strategy outline, but I think that it > > Needs to be configurable by the client such that users and/or > > Customer Support can disable lockfiles / disable ioctl in > > Case they detect that they are runing on an OS / Kernal that > > Does not support one or the other. > > Yes, this would be good I guess... Applications could offer > configuration options to control that, maybe similarily as > minicom. > > BTW, man minicom tells: > > *B - Lock file location > On most systems This should be /usr/spool/uucp. > Linux systems use /var/lock. If this directory > does not exist, minicom will not attempt to use > lockfiles. > > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure > and expedient electronic transaction acceptance. Ingenico products leverage > proven technology, established standards and unparalleled ergonomics to > provide optimal reliability, versatility and usability. This comprehensive > range of products is complemented by a global array of services and > partnerships, enabling businesses in a number of vertical sectors to accept > transactions anywhere their business takes them. www.ingenico.com This > message may contain confidential and/or privileged information. If you are > not the addressee or authorized to receive this for the addressee, you must > not use, copy, disclose or take any action based on this message or any > information herein. If you have received this message in error, please > advise the sender immediately by reply e-mail and delete this message. > Thank you for your cooperation. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Wed Apr 30 19:30:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 30 Apr 2008 19:30:51 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804301028.09307.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> <200804301028.09307.scldad@sdc.com.au> Message-ID: Hi Stephen, I suspect ioctl/TIOCEXCL open/O_EXCL would do the job. Mac uses TIOCEXCL and it is POSIX. We use O_EXCL for lockfiles on Linux already. On Wed, 30 Apr 2008, Stephen Davies wrote: > I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is > the same. > > Any ideas as to how to handle this? > > Stephen > > > On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: >> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: >>> The biggest problem that I have seen with lockfiles on Linux >>> At least is, that it seems there is no standard with respect >>> To the folder in which they should be created. Also, many >>> Distributions seem to set up file system permissions in such >>> A way that writing to the lockfile folder is not allowed for >>> The normal user -- that's why we stopped using lockfiles >>> In our commercial product. >> >> It seems it depends on the expectations. I consider it as a >> feature that by default a linux user cannot access serial ports. >> Maybe root connected a modem (can produce phone bills) or even >> some serial card reader, maybe with the web servers key pair. >> >> I would expect that by default a user cannot open the serial port >> because of insufficient permissions on the device file. I would >> expect this on other unices as well (but I don't know it). >> >> For windows I think it should be similar but not impacting so >> much in practice, because often windows users work with big >> permissions on a somewhat high priviledge level or even >> Administrator. >> >>> If we are to still respect lockfiles, we first need to >>> Understand where we are expected to look for them. Does >>> Anybody have any insight what variants of lockfile folder >>> Schema exist out there in the wild? Some apps like minicom >>> Seem to even allow users to manually specify a lockfile >>> Folder of their choice. >> >> At least my (ancient) minicom does not allow the user to change >> this option, it is displayed but read-only, but root is allowed >> to change it. >> >>> Because of the difficulty finding the right lockfile folder, >>> And because of the inherent risk of thinking that something >>> Might be locked while it actually isn't, I'd suggest that >>> RXTX should have a "soft-off" feature that allows disabling >>> ALL Lockfile checks at runtime without recompiling the native >>> Sharedlibs. >> >> sounds very reasonable, yes... >> and as admin I would not wish that users could skip such >> locking because they do things wrong by default ;) >> >> (in the end I guess that is related to the dilemma, that >> hotplug/user-owned-periphery and multi-user systems simply >> conflict) >> >>> Trent - I like your strategy outline, but I think that it >>> Needs to be configurable by the client such that users and/or >>> Customer Support can disable lockfiles / disable ioctl in >>> Case they detect that they are runing on an OS / Kernal that >>> Does not support one or the other. >> >> Yes, this would be good I guess... Applications could offer >> configuration options to control that, maybe similarily as >> minicom. >> >> BTW, man minicom tells: >> >> *B - Lock file location >> On most systems This should be /usr/spool/uucp. >> Linux systems use /var/lock. If this directory >> does not exist, minicom will not attempt to use >> lockfiles. >> >> The statement `Linux systems use /var/lock' is interesting, does >> anyone know the source of this convention? >> >> oki, >> >> Steffen >> >> About Ingenico Throughout the world businesses rely on Ingenico for secure >> and expedient electronic transaction acceptance. Ingenico products leverage >> proven technology, established standards and unparalleled ergonomics to >> provide optimal reliability, versatility and usability. This comprehensive >> range of products is complemented by a global array of services and >> partnerships, enabling businesses in a number of vertical sectors to accept >> transactions anywhere their business takes them. www.ingenico.com This >> message may contain confidential and/or privileged information. If you are >> not the addressee or authorized to receive this for the addressee, you must >> not use, copy, disclose or take any action based on this message or any >> information herein. If you have received this message in error, please >> advise the sender immediately by reply e-mail and delete this message. >> Thank you for your cooperation. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0056.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0054.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0041.html From pboulton at pulsetracer.com Fri Apr 18 14:30:13 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Fri, 18 Apr 2008 13:30:13 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site Message-ID: <480904D5.1060307@pulsetracer.com> Hello, gentle serial porters. I have downloaded the zipped up binaries for use on Windows without Sun's CommAPI, but don't seem able to extract anything from the download. Go to main page, http://www.rxtx.org/ Click on Downloads I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) And I save it to disk. If I try and extract the files with WinZip, Winzip thinks the archive is corrupt. If I try using Windows Explorer, I am able to extract it into a single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than the original .zip. Any help would be much appreciated. Sincerely, Philip Boulton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080418/97d89793/attachment-0039.html From tjarvi at qbang.org Fri Apr 18 19:07:00 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 18 Apr 2008 19:07:00 -0600 (MDT) Subject: [Rxtx] Difficulty opening zip file at rxtx site In-Reply-To: <480904D5.1060307@pulsetracer.com> References: <480904D5.1060307@pulsetracer.com> Message-ID: On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org From pboulton at pulsetracer.com Sat Apr 19 12:46:26 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Sat, 19 Apr 2008 11:46:26 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site References: <480904D5.1060307@pulsetracer.com> Message-ID: <53DB7576450695419E09299104043761A78533@ZTGSERVER.ztg.local> I have been able to get my hands on the binaries, by going to the ftp directory /pub/rxtx at ftp.qbang.org,, and ftping the file rxtx-2.1-7-bins-r2.zip . This opens happily with Winzip, and extracts as the set of files that you describe below. I only experience the ill-formed archive problem by clicking the link on the rxtx.org Downloads page (http://rxtx.qbang.org/pub/rxtx/ rxtx-2.1-7-bins-r2.zip ). Not sure what to make of that. Philip Boulton ________________________________ From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Fri 4/18/2008 6:07 PM To: Philip Boulton Cc: rxtx at qbang.org Subject: Re: [Rxtx] Difficulty opening zip file at rxtx site On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080419/147923bb/attachment-0038.html From jlar310 at gmail.com Sat Apr 19 19:11:55 2008 From: jlar310 at gmail.com (Jeff Larsen) Date: Sat, 19 Apr 2008 20:11:55 -0500 Subject: [Rxtx] Moxa serial over Ethernet driver Message-ID: Hi all, I've been using javax.comm for years to communicate with a legacy radio data system. We want to migrate the java side of the system to a VMware Server virtual machine. We've had great success using Moxa DE-303 and 5610 serial over Ethernet appliances and virtual machines for running hylafax. The OS (Linux in this case) uses a kernel driver to communicate with the Moxa via a virtual serial port such as /dev/ttyr00. I want to do the same thing with javax.comm or gnu.io to connect to a virtual serial port. However I'm hitting road blocks everywhere. javax.comm for Linux sees the virtual port, but there are transmission errors. Tried Solaris too, but the Solaris Moxa drivers don't play nice with javax.comm because the driver uses /dev/pts/n instead of /dev/term/x. Next I tried RXTX on Linux, but I'm getting NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX on Solaris. Has anyone used RXTX with serial over Ethernet devices? Any hints on how to make it work? I know that I'm not completely off track because javax.comm does work with Moxa on a Windows platform, but that's just not an option for production deployment. -- Jeff From tjarvi at qbang.org Sat Apr 19 21:08:41 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 19 Apr 2008 21:08:41 -0600 (MDT) Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: yOn Sat, 19 Apr 2008, Jeff Larsen wrote: > Hi all, > > I've been using javax.comm for years to communicate with a legacy > radio data system. We want to migrate the java side of the system to a > VMware Server virtual machine. We've had great success using Moxa > DE-303 and 5610 serial over Ethernet appliances and virtual machines > for running hylafax. The OS (Linux in this case) uses a kernel driver > to communicate with the Moxa via a virtual serial port such as > /dev/ttyr00. > > I want to do the same thing with javax.comm or gnu.io to connect to a > virtual serial port. However I'm hitting road blocks everywhere. > javax.comm for Linux sees the virtual port, but there are transmission > errors. Tried Solaris too, but the Solaris Moxa drivers don't play > nice with javax.comm because the driver uses /dev/pts/n instead of > /dev/term/x. Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris. > > Has anyone used RXTX with serial over Ethernet devices? Any hints on > how to make it work? > > I know that I'm not completely off track because javax.comm does work > with Moxa on a Windows platform, but that's just not an option for > production deployment. > > Moxa should work under linux. There may be minor issues depending upon how complete the kernel driver is but I think it will work. One of the minor issues is /dev/ttyr00 is not enumerated. There are several work arounds documented with the source code and on the wiki. The easiest solution for testing purposes is to make a symbolic link from /dev/ttyr00 to a port that is enumerated such as /dev/ttyS129. You can later alter the rxtx source or use properties to change the enumerated ports. -- Trent Jarvi tjarvi at qbang.org From d.tonhofer at m-plify.com Sun Apr 20 03:33:30 2008 From: d.tonhofer at m-plify.com (David Tonhofer (M-PLIFY S.A.)) Date: Sun, 20 Apr 2008 11:33:30 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: <480B0DEA.5010908@m-plify.com> Jeff Larsen wrote: > Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris It might be that the Java side of RXTX does not recognize that portname. Trying modifying src/RXTXCommDriver.java as described in this case: http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card From ajmas at sympatico.ca Sun Apr 20 16:37:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Apr 2008 18:37:59 -0400 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <480B0DEA.5010908@m-plify.com> References: <480B0DEA.5010908@m-plify.com> Message-ID: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > Jeff Larsen wrote: >> Next I tried RXTX on Linux, but I'm getting >> NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX >> on Solaris > It might be that the Java side of RXTX does not recognize that > portname. > Trying modifying src/RXTXCommDriver.java as described in this case: > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card I wonder whether it would be worth allowing custom port prefixes as a system parameter? For example: gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" Andre From Martin.Oberhuber at windriver.com Tue Apr 22 12:34:36 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 22 Apr 2008 20:34:36 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> References: <480B0DEA.5010908@m-plify.com> <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE6485848056CD6CE@ism-mail03.corp.ad.wrs.com> Sounds like a great idea... I'm wondering how the "variable part" after the Prefixes could be specified though? What about allowing Regular Expression character Classes in the existing System Property for specifying ports: System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyS[0-9],ttyS[ABC],ttyUSB[0-9a-z]"); The set of allowed patterns would of course need to Be restricted compared to REGEX, because it must be A syntax that supports iterating over it. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Montag, 21. April 2008 00:38 > To: rxtx at qbang.org and Users > Subject: Re: [Rxtx] Moxa serial over Ethernet driver > > > On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > > Jeff Larsen wrote: > >> Next I tried RXTX on Linux, but I'm getting > >> NoSuchPortException connecting to /dev/ttyr00. I have yet > to try RXTX > >> on Solaris > > It might be that the Java side of RXTX does not recognize that > > portname. > > Trying modifying src/RXTXCommDriver.java as described in this case: > > > > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_ > SST-4P.2FLP_multiport_card > > I wonder whether it would be worth allowing custom port > prefixes as a > system parameter? For > example: > > gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Loi.TRAN at weatherford.com Tue Apr 22 13:10:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Tue, 22 Apr 2008 14:10:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled Message-ID: Hi, I'm currently using the Java RXTX API to interface to a serial port. The serial port is connected to a bridge board that communicates with our communications system running at 1.875 Mbps which is linked to an embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no flow control). I send a command to the embedded board through the serial-bridge board which then is relayed to the embedded board. The command sent asks the embedded board to dump a binary image. Here's where I'm hitting some problems. I've successfully done this is an integrated serial port from the laptop. The binary file that comes back is consistent on every attempt. When I use the application I've written to do the same thing with a USB-to-serial adapter, the image I get back is not the same as the image I receive through the USB-to-serial adapter is not consistent at all. A final thing is that when I use a terminal program to dump the binary image with the USB-serial adapter, the image is correct. Every time! What is the terminal program doing that's not being done in my application? My application is quite simple. Has anyone observed this behavior before? If you have, I'd like to know how you've gotten around this problem. Thanks, LT =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From tjarvi at qbang.org Tue Apr 22 21:11:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 22 Apr 2008 21:11:10 -0600 (MDT) Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org From Loi.TRAN at weatherford.com Wed Apr 23 08:35:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Wed, 23 Apr 2008 09:35:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: Thanks for all the responses. I finally tried something that worked consistently. I updated my Prolific driver and repeated my tests. It worked. If you're using the Prolific type USB-serial adapters, do no use the Prolific version 2.0.2.1 driver on Windows. Update it to the latest 2.0.2.8 version. Again, thanks for all the responses. LT -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Tuesday, April 22, 2008 10:11 PM To: TRAN, Loi X. Cc: rxtx at qbang.org Subject: Re: [Rxtx] Prolific USB - RXTX data mangled On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From Martin.Oberhuber at windriver.com Wed Apr 23 18:54:26 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 02:54:26 +0200 Subject: [Rxtx] RXTX port locking on Linux status? Message-ID: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Dear RXTX community, I'm wondering what the status is with RXTX locking serial ports on Linux? My understanding is that the mechanism used in 2.1-7r2 (lockfiles) is not really state of the art, and has lots of problems (e.g. missing permissions). There was an idea to migrate towards a Kernel syscall based solution for port locking. What's the status here? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/9878db9f/attachment-0034.html From tjarvi at qbang.org Wed Apr 23 20:32:24 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Apr 2008 20:32:24 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > Dear RXTX community, > > I'm wondering what the status is with RXTX locking > serial ports on Linux? > > My understanding is that the mechanism used in > 2.1-7r2 (lockfiles) is not really state of the art, and > has lots of problems (e.g. missing permissions). > > There was an idea to migrate towards a Kernel > syscall based solution for port locking. > > What's the status here? > Hi Martin, I'm in favor of deprecating the current FHS locking mechanism in favor of an IOCTL when available. I think it will be available on all the platforms but do not know for sure. The status is unchanged. I've had very few free cycles for such things. Feel free to take a stab at it if you have some time. I believe the IOCTL is used in the Mac OS X code already. I don't see any real backwards compatability issues and the IOCTL should just work. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Apr 24 06:14:06 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 14:14:06 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Thanks Trent. Problem is only that I'm really not at all Familiar with the C part of RXTX. If there Were anything I could do in Java for this, It would be easier for me.... ... Are there any C experts here on the list Who'd like to look at ioctl port locking For linux? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Donnerstag, 24. April 2008 04:32 > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > I'm wondering what the status is with RXTX locking > > serial ports on Linux? > > > > My understanding is that the mechanism used in > > 2.1-7r2 (lockfiles) is not really state of the art, and > > has lots of problems (e.g. missing permissions). > > > > There was an idea to migrate towards a Kernel > > syscall based solution for port locking. > > > > What's the status here? > > > > Hi Martin, > > I'm in favor of deprecating the current FHS locking mechanism > in favor of > an IOCTL when available. I think it will be available on all the > platforms but do not know for sure. > > The status is unchanged. I've had very few free cycles for > such things. > Feel free to take a stab at it if you have some time. I > believe the IOCTL > is used in the Mac OS X code already. > > I don't see any real backwards compatability issues and the > IOCTL should > just work. > > -- > Trent Jarvi > tjarvi at qbang.org > From sspies at sloc.de Thu Apr 24 07:15:36 2008 From: sspies at sloc.de (Sebastian Spies) Date: Thu, 24 Apr 2008 15:15:36 +0200 (CEST) Subject: [Rxtx] rxtx on gumstix: Interrupted system call In-Reply-To: <47FB7B20.7080504@sloc.de> References: <47FB7B20.7080504@sloc.de> Message-ID: <55445.130.83.139.205.1209042936.squirrel@ssl.sloc.de> Dear list, while porting rxtx to the gumstix, I found out, that select used in readArray in SerialImp.c might not work as expected. Maybe, because of missing TIOCSERGETLSR-support? select is often interrupted, so i wrote the following quick'n'dirty hack to make it work on gumstix: diff -Nur rxtx-2.1-7r2/src/SerialImp.c rxtx-2.1-7r2/src/SerialImp.c --- rxtx-2.1-7r2/src/SerialImp.c 2006-01-29 23:19:04.000000000 +0100 +++ rxtx-2.1-7r2-patched/src/SerialImp.c 2008-04-24 14:30:17.000000000 +0200 @@ -3380,7 +3381,7 @@ JNIEXPORT jint JNICALL RXTXPort(readArray)( JNIEnv *env, jobject jobj, jbyteArray jbarray, jint offset, jint length ) { - int bytes; + int bytes = 0; jbyte *body; /* char msg[80]; */ int fd = get_java_var( env, jobj, "fd", "I" ); @@ -3397,9 +3398,18 @@ "readArray", "Invalid length" ); return -1; } - body = (*env)->GetByteArrayElements( env, jbarray, 0 ); - bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ - (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + while(1 > bytes) + { + body = (*env)->GetByteArrayElements( env, jbarray, 0 ); + bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ + (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + // quick'n'dirty - SSP + report (" trying again... \n"); + errno = 0; + } + if( bytes < 0 ) { report( "RXTXPort:readArray bytes < 0" ); LEAVE( "RXTXPort:readArray" ); > Hey, > > I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use > RXTXPort$SerialInputStream.read(), then I get the following Exception. I > did not yet figure out which system call is interrupted as strace > produces loads of output. > > Any help would be very appreciated. Thanks in advance. > Sebastian > > > [java] java.io.IOException: Interrupted system call in readArray > [java] at gnu.io.RXTXPort.readArray(Native Method) > [java] at > gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) > [java] at > java.io.FilterInputStream.read(FilterInputStream.java:189) > [java] at > java.io.BufferedInputStream.refill(BufferedInputStream.java:371) > [java] at > java.io.BufferedInputStream.read(BufferedInputStream.java:229) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) > [java] at > com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) > > -- > Sebastian Spies > > mail: sspies at sloc.de > > > > From fire_baptized at hotmail.com Thu Apr 24 18:27:48 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Thu, 24 Apr 2008 20:27:48 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hello I am having a problem with the serial device connecting (software wise) to the serial port. However I have a test program and it seems to work just fine in that environment - and it doesnt use GUI. The error I am getting is : PortNotFoundException Now the way I have it setup in the GUI environment is that once the user pushes a JButton the program connects using this class: protected void establishConnection() { try { portId = CommPortIdentifier.getPortIdentifier("COM3"); System.out.println("Establishing connction....."); messages[0] = "\nEstablishing connction.....\n"; } catch ( NoSuchPortException noport) { System.out.println("Port not found: "+ noport); messages[0] = "Port not found: "+ noport+"\n"; } try { serialPort = (SerialPort) portId.open("serial", 50); System.out.println("Port has been found."); messages[1] = "Port has been found.\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[1] = "" +usedport; } try { serialPort = (SerialPort) portId.open("serial", 50); messages[2] = "Connecting to COM3 on port 50....\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; } try { serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); System.out.println("Esablishing the transfer rate settings for COM3."); messages[3] = "Esablishing the transfer rate settings for COM3.\n"; } catch (UnsupportedCommOperationException nosupcom) { System.out.println(nosupcom); System.out.println("The tranfer rate could not be esblished on COM3."); messages[3] = "The tranfer rate could not be esblished on COM3.\n"; } System.out.println(serialPort.getFlowControlMode()); messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; //sendDataOut(buffer[3],buffer[4]); } I need all the data in this method (and all the string values in this method) to be printed out on a JTextArea. I wont do me any good if not all the text is printed on a JTextArea in another class. So I have the text printing the JTextArea correctly, but everytime the JButton is activated - it gives me that error message. I did add a disconnect button that is supposed to call the serialPort.close(). _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/273fd4ec/attachment-0033.html From tjarvi at qbang.org Thu Apr 24 21:54:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Apr 2008 21:54:10 -0600 (MDT) Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > Hello I am having a problem with the serial device connecting (software > wise) to the serial port. However I have a test program and it seems to > work just fine in that environment - and it doesnt use GUI. The error I > am getting is : PortNotFoundException Now the way I have it setup in the > GUI environment is that once the user pushes a JButton the program > connects using this class: > > protected void establishConnection() { > try { > portId = CommPortIdentifier.getPortIdentifier("COM3"); > System.out.println("Establishing connction....."); > messages[0] = "\nEstablishing connction.....\n"; > } > catch ( NoSuchPortException noport) { > System.out.println("Port not found: "+ noport); > messages[0] = "Port not found: "+ noport+"\n"; > } > try { > serialPort = (SerialPort) portId.open("serial", 50); > System.out.println("Port has been found."); > messages[1] = "Port has been found.\n"; > } > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[1] = "" +usedport; > } ================================================================= > try { > serialPort = (SerialPort) portId.open("serial", 50); > messages[2] = "Connecting to COM3 on port 50....\n"; > } ================================================================== > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > } > try { > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > System.out.println("Esablishing the transfer rate settings for COM3."); > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > } > catch (UnsupportedCommOperationException nosupcom) { > System.out.println(nosupcom); > System.out.println("The tranfer rate could not be esblished on COM3."); > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > } > System.out.println(serialPort.getFlowControlMode()); > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > //sendDataOut(buffer[3],buffer[4]); > } > > I need all the data in this method (and all the string values in this > method) to be printed out on a JTextArea. I wont do me any good if not > all the text is printed on a JTextArea in another class. So I have the > text printing the JTextArea correctly, but everytime the JButton is > activated - it gives me that error message. I did add a disconnect > button that is supposed to call the serialPort.close(). > The open code used twice is going to throw an exception. It may be that you catch the exception above this code and print a confusing message? A common mistake is people will accidently run two copies of their program. The first instance of the program will open the port and prevent enumeration (finding the port) in the second instance of the program. As an example, you may be running your text based application which is preventing the GUI from seeing the port. Enumeration is done by trying to open the port. If the port is open, Enumeration fails. -- Trent Jarvi tjarvi at qbang.org From fire_baptized at hotmail.com Thu Apr 24 22:32:05 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 00:32:05 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Wow - thanks dude what a dumb thing for me to not catch..... now here is the current problem - right now I am trying to output data again one is with the test program - and it seems that serialPort.setRTS(true); is throwing an exceptions there - now if I show this code please bare in mind that I am only testing - the code is kinda sloppy in my mind - but if I can figure out why calling this function is throwing an exception then maybe I can figure out why my GUI application is getting the same null pointer exceptions when try to send out the data stream. FYI Trent this email is not directed towards you - anyone can jump in on this public static void main(String args[]) { byte[] b = new byte[64]; int keyinput = 0 ; byte x = 0; byte y = 0; PortTesting1 testports = new PortTesting1(); try { joyskoro = Joystick.createInstance(); } catch (IOException ioexc) { System.out.println("There is an input/output problem: " + ioexc); } while (true) { joyskoro.poll(); b[0] = ((byte) -(10 * joyskoro.getY())); b[1] = ((byte) (10 * joyskoro.getX())); System.out.println("The 3rd byte is: " +b[0]); System.out.println("The 4rd byte is: " +b[1]); serialPort.setRTS(true); // HERE IS WHERE THE PROBLEM IS !!!!!!! ON THIS LINE but if I dont have it active in my program the Bluetooth device (that is System.out.println("Ready to send :-) !"); //connected to the serial port does not send out data!!!!! if (joyskoro.isButtonDown(joyskoro.BUTTON10)) { System.out.println("Connection terminated."); serialPort.close(); break; } if (joyskoro.isButtonDown(joyskoro.BUTTON2)) { boolean flag = true; //reading from key input from the keyboard System.out.println("Please input a command: "); while (flag) { try { keyinput = System.in.read(); } catch (IOException ioexc) {/*there is no need to put * anything here */ } if((char)keyinput=='w') { pushIt((byte)85); } if((char)keyinput=='s') { pushIt((byte)84); } if((char)keyinput=='a') { pushIt((byte)83); } if((char)keyinput=='d') { pushIt((byte)82); } if((char)keyinput=='q') { pushIt((byte)89); } if((char)keyinput=='\t') { //this stop reading input from the keyboard flag = false; } } and help anyways here is the block of code that throwing an exception for the test program: > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/5c8f7d68/attachment-0033.html From fire_baptized at hotmail.com Fri Apr 25 07:59:53 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 09:59:53 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Are there any examples of how to push out data? As in using input and output streams - if I can compare code maybe I can see where this is causing a problem. I have a byte array that I am pushing out data. I keep getting null pointer exceptions every where I turn. > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/22228ab6/attachment-0032.html From ajmas at sympatico.ca Sat Apr 26 07:37:09 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 26 Apr 2008 09:37:09 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hi, On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote: > > Are there any examples of how to push out data? As in using input > and output streams - if I can compare code maybe I can see where > this is causing a problem. I have a byte array that I am pushing > out data. I keep getting null pointer exceptions every where I turn. > There are some examples here that might be of help: http://rxtx.qbang.org/wiki/index.php/Examples Andre From fire_baptized at hotmail.com Sat Apr 26 20:13:54 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Sat, 26 Apr 2008 22:13:54 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: looked at those....yep didnt help - I need to push out data with GUI and not get a null pointer exception everytime I try. > CC: rxtx at qbang.org> From: ajmas at sympatico.ca> To: fire_baptized at hotmail.com> Subject: Re: [Rxtx] Serial Problems with Gui.....> Date: Sat, 26 Apr 2008 09:37:09 -0400> > Hi,> > > On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote:> >> > Are there any examples of how to push out data? As in using input > > and output streams - if I can compare code maybe I can see where > > this is causing a problem. I have a byte array that I am pushing > > out data. I keep getting null pointer exceptions every where I turn.> >> > There are some examples here that might be of help:> > http://rxtx.qbang.org/wiki/index.php/Examples> > Andre _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080426/09f95b41/attachment-0031.html From michael.erskine at ketech.com Mon Apr 28 02:47:22 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 28 Apr 2008 09:47:22 +0100 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D426EF3CBBC5@no-sv-03.ketech.local> Jesrael D. Summerhill wrote: > looked at those....yep didnt help - I need to push out data with GUI and > not get a null pointer exception everytime I try. So it seems pretty obvious that your code needs to check for nulls wherever one may occur and report what's happening. Alternatively, catch the npe and display the stack trace. Then you can fix your code so it doesn't try to work with something that ain't there. Regards, Michael Erskine. From scldad at sdc.com.au Mon Apr 28 03:58:34 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Mon, 28 Apr 2008 19:28:34 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Message-ID: <200804281928.34454.scldad@sdc.com.au> Has anybody done any design work on this? The first thing that springs to mind is that we still need to check for lock files because other apps tend to use that approach even if we go to ioctl. Cheers, Stephen Davies On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > Thanks Trent. > > Problem is only that I'm really not at all > Familiar with the C part of RXTX. If there > Were anything I could do in Java for this, > It would be easier for me.... > > ... Are there any C experts here on the list > Who'd like to look at ioctl port locking > For linux? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > -----Original Message----- > > From: Trent Jarvi [mailto:tjarvi at qbang.org] > > Sent: Donnerstag, 24. April 2008 04:32 > > To: Oberhuber, Martin > > Cc: rxtx at qbang.org > > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > > > I'm wondering what the status is with RXTX locking > > > serial ports on Linux? > > > > > > My understanding is that the mechanism used in > > > 2.1-7r2 (lockfiles) is not really state of the art, and > > > has lots of problems (e.g. missing permissions). > > > > > > There was an idea to migrate towards a Kernel > > > syscall based solution for port locking. > > > > > > What's the status here? > > > > Hi Martin, > > > > I'm in favor of deprecating the current FHS locking mechanism > > in favor of > > an IOCTL when available. I think it will be available on all the > > platforms but do not know for sure. > > > > The status is unchanged. I've had very few free cycles for > > such things. > > Feel free to take a stab at it if you have some time. I > > believe the IOCTL > > is used in the Mac OS X code already. > > > > I don't see any real backwards compatability issues and the > > IOCTL should > > just work. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Mon Apr 28 04:21:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 28 Apr 2008 04:21:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804281928.34454.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: I don't think there would need to be any architectural changes. A couple ifdefs and minor changes in the current code should be enough. Proposal: FHS/UUCP locks: continue to respect them, try to create them but do not error if the IOCTL is supported. (But does the IOCTL being defined mean it will work?) Enumeration: Do not assert the IOCTL while opening. Serial.open: assert the IOCTL after open. Continue to use locks as described above after asserting the IOCTL. If the IOCTL is defined but not working, handle it here. Failure cases include the IOCTL is not supported and the port is already locked. On Mon, 28 Apr 2008, Stephen Davies wrote: > Has anybody done any design work on this? > The first thing that springs to mind is that we still need to check for lock > files because other apps tend to use that approach even if we go to ioctl. > > Cheers, > Stephen Davies > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: >> Thanks Trent. >> >> Problem is only that I'm really not at all >> Familiar with the C part of RXTX. If there >> Were anything I could do in Java for this, >> It would be easier for me.... >> >> ... Are there any C experts here on the list >> Who'd like to look at ioctl port locking >> For linux? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >>> -----Original Message----- >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] >>> Sent: Donnerstag, 24. April 2008 04:32 >>> To: Oberhuber, Martin >>> Cc: rxtx at qbang.org >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? >>> >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: >>>> Dear RXTX community, >>>> >>>> I'm wondering what the status is with RXTX locking >>>> serial ports on Linux? >>>> >>>> My understanding is that the mechanism used in >>>> 2.1-7r2 (lockfiles) is not really state of the art, and >>>> has lots of problems (e.g. missing permissions). >>>> >>>> There was an idea to migrate towards a Kernel >>>> syscall based solution for port locking. >>>> >>>> What's the status here? >>> >>> Hi Martin, >>> >>> I'm in favor of deprecating the current FHS locking mechanism >>> in favor of >>> an IOCTL when available. I think it will be available on all the >>> platforms but do not know for sure. >>> >>> The status is unchanged. I've had very few free cycles for >>> such things. >>> Feel free to take a stab at it if you have some time. I >>> believe the IOCTL >>> is used in the Mac OS X code already. >>> >>> I don't see any real backwards compatability issues and the >>> IOCTL should >>> just work. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Tue Apr 29 12:04:04 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Apr 2008 20:04:04 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Hi all, The biggest problem that I have seen with lockfiles on Linux At least is, that it seems there is no standard with respect To the folder in which they should be created. Also, many Distributions seem to set up file system permissions in such A way that writing to the lockfile folder is not allowed for The normal user -- that's why we stopped using lockfiles In our commercial product. If we are to still respect lockfiles, we first need to Understand where we are expected to look for them. Does Anybody have any insight what variants of lockfile folder Schema exist out there in the wild? Some apps like minicom Seem to even allow users to manually specify a lockfile Folder of their choice. Because of the difficulty finding the right lockfile folder, And because of the inherent risk of thinking that something Might be locked while it actually isn't, I'd suggest that RXTX should have a "soft-off" feature that allows disabling ALL Lockfile checks at runtime without recompiling the native Sharedlibs. Trent - I like your strategy outline, but I think that it Needs to be configurable by the client such that users and/or Customer Support can disable lockfiles / disable ioctl in Case they detect that they are runing on an OS / Kernal that Does not support one or the other. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Montag, 28. April 2008 12:22 > To: Stephen Davies > Cc: rxtx at qbang.org; Oberhuber, Martin; Trent Jarvi > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > I don't think there would need to be any architectural > changes. A couple > ifdefs and minor changes in the current code should be enough. > > Proposal: > > FHS/UUCP locks: > continue to respect them, try to create them but do not error if > the IOCTL is supported. (But does the IOCTL being defined mean > it will work?) > Enumeration: > Do not assert the IOCTL while opening. > Serial.open: > assert the IOCTL after open. Continue to use locks as described > above after asserting the IOCTL. If the IOCTL is defined but > not working, handle it here. Failure cases include the IOCTL > is not supported and the port is already locked. > > On Mon, 28 Apr 2008, Stephen Davies wrote: > > > Has anybody done any design work on this? > > The first thing that springs to mind is that we still need > to check for lock > > files because other apps tend to use that approach even if > we go to ioctl. > > > > Cheers, > > Stephen Davies > > > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > >> Thanks Trent. > >> > >> Problem is only that I'm really not at all > >> Familiar with the C part of RXTX. If there > >> Were anything I could do in Java for this, > >> It would be easier for me.... > >> > >> ... Are there any C experts here on the list > >> Who'd like to look at ioctl port locking > >> For linux? > >> > >> Thanks, > >> -- > >> Martin Oberhuber, Senior Member of Technical Staff, Wind River > >> Target Management Project Lead, DSDP PMC Member > >> http://www.eclipse.org/dsdp/tm > >> > >>> -----Original Message----- > >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] > >>> Sent: Donnerstag, 24. April 2008 04:32 > >>> To: Oberhuber, Martin > >>> Cc: rxtx at qbang.org > >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? > >>> > >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > >>>> Dear RXTX community, > >>>> > >>>> I'm wondering what the status is with RXTX locking > >>>> serial ports on Linux? > >>>> > >>>> My understanding is that the mechanism used in > >>>> 2.1-7r2 (lockfiles) is not really state of the art, and > >>>> has lots of problems (e.g. missing permissions). > >>>> > >>>> There was an idea to migrate towards a Kernel > >>>> syscall based solution for port locking. > >>>> > >>>> What's the status here? > >>> > >>> Hi Martin, > >>> > >>> I'm in favor of deprecating the current FHS locking mechanism > >>> in favor of > >>> an IOCTL when available. I think it will be available on all the > >>> platforms but do not know for sure. > >>> > >>> The status is unchanged. I've had very few free cycles for > >>> such things. > >>> Feel free to take a stab at it if you have some time. I > >>> believe the IOCTL > >>> is used in the Mac OS X code already. > >>> > >>> I don't see any real backwards compatability issues and the > >>> IOCTL should > >>> just work. > >>> > >>> -- > >>> Trent Jarvi > >>> tjarvi at qbang.org > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > From Steffen.DETTMER at ingenico.com Tue Apr 29 13:34:44 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 29 Apr 2008 21:34:44 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Message-ID: <20080429193444.GU2928@elberon.bln.de.ingenico.com> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > The biggest problem that I have seen with lockfiles on Linux > At least is, that it seems there is no standard with respect > To the folder in which they should be created. Also, many > Distributions seem to set up file system permissions in such > A way that writing to the lockfile folder is not allowed for > The normal user -- that's why we stopped using lockfiles > In our commercial product. It seems it depends on the expectations. I consider it as a feature that by default a linux user cannot access serial ports. Maybe root connected a modem (can produce phone bills) or even some serial card reader, maybe with the web servers key pair. I would expect that by default a user cannot open the serial port because of insufficient permissions on the device file. I would expect this on other unices as well (but I don't know it). For windows I think it should be similar but not impacting so much in practice, because often windows users work with big permissions on a somewhat high priviledge level or even Administrator. > If we are to still respect lockfiles, we first need to > Understand where we are expected to look for them. Does > Anybody have any insight what variants of lockfile folder > Schema exist out there in the wild? Some apps like minicom > Seem to even allow users to manually specify a lockfile > Folder of their choice. At least my (ancient) minicom does not allow the user to change this option, it is displayed but read-only, but root is allowed to change it. > Because of the difficulty finding the right lockfile folder, > And because of the inherent risk of thinking that something > Might be locked while it actually isn't, I'd suggest that > RXTX should have a "soft-off" feature that allows disabling > ALL Lockfile checks at runtime without recompiling the native > Sharedlibs. sounds very reasonable, yes... and as admin I would not wish that users could skip such locking because they do things wrong by default ;) (in the end I guess that is related to the dilemma, that hotplug/user-owned-periphery and multi-user systems simply conflict) > Trent - I like your strategy outline, but I think that it > Needs to be configurable by the client such that users and/or > Customer Support can disable lockfiles / disable ioctl in > Case they detect that they are runing on an OS / Kernal that > Does not support one or the other. Yes, this would be good I guess... Applications could offer configuration options to control that, maybe similarily as minicom. BTW, man minicom tells: *B - Lock file location On most systems This should be /usr/spool/uucp. Linux systems use /var/lock. If this directory does not exist, minicom will not attempt to use lockfiles. The statement `Linux systems use /var/lock' is interesting, does anyone know the source of this convention? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Tue Apr 29 16:11:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Apr 2008 16:11:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? These details are outlined in the Filesystem Hierarchy Standard (FHS). http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLOCKLOCKFILES -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Tue Apr 29 18:58:09 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Wed, 30 Apr 2008 10:28:09 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: <200804301028.09307.scldad@sdc.com.au> I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is the same. Any ideas as to how to handle this? Stephen On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: > * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > > The biggest problem that I have seen with lockfiles on Linux > > At least is, that it seems there is no standard with respect > > To the folder in which they should be created. Also, many > > Distributions seem to set up file system permissions in such > > A way that writing to the lockfile folder is not allowed for > > The normal user -- that's why we stopped using lockfiles > > In our commercial product. > > It seems it depends on the expectations. I consider it as a > feature that by default a linux user cannot access serial ports. > Maybe root connected a modem (can produce phone bills) or even > some serial card reader, maybe with the web servers key pair. > > I would expect that by default a user cannot open the serial port > because of insufficient permissions on the device file. I would > expect this on other unices as well (but I don't know it). > > For windows I think it should be similar but not impacting so > much in practice, because often windows users work with big > permissions on a somewhat high priviledge level or even > Administrator. > > > If we are to still respect lockfiles, we first need to > > Understand where we are expected to look for them. Does > > Anybody have any insight what variants of lockfile folder > > Schema exist out there in the wild? Some apps like minicom > > Seem to even allow users to manually specify a lockfile > > Folder of their choice. > > At least my (ancient) minicom does not allow the user to change > this option, it is displayed but read-only, but root is allowed > to change it. > > > Because of the difficulty finding the right lockfile folder, > > And because of the inherent risk of thinking that something > > Might be locked while it actually isn't, I'd suggest that > > RXTX should have a "soft-off" feature that allows disabling > > ALL Lockfile checks at runtime without recompiling the native > > Sharedlibs. > > sounds very reasonable, yes... > and as admin I would not wish that users could skip such > locking because they do things wrong by default ;) > > (in the end I guess that is related to the dilemma, that > hotplug/user-owned-periphery and multi-user systems simply > conflict) > > > Trent - I like your strategy outline, but I think that it > > Needs to be configurable by the client such that users and/or > > Customer Support can disable lockfiles / disable ioctl in > > Case they detect that they are runing on an OS / Kernal that > > Does not support one or the other. > > Yes, this would be good I guess... Applications could offer > configuration options to control that, maybe similarily as > minicom. > > BTW, man minicom tells: > > *B - Lock file location > On most systems This should be /usr/spool/uucp. > Linux systems use /var/lock. If this directory > does not exist, minicom will not attempt to use > lockfiles. > > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure > and expedient electronic transaction acceptance. Ingenico products leverage > proven technology, established standards and unparalleled ergonomics to > provide optimal reliability, versatility and usability. This comprehensive > range of products is complemented by a global array of services and > partnerships, enabling businesses in a number of vertical sectors to accept > transactions anywhere their business takes them. www.ingenico.com This > message may contain confidential and/or privileged information. If you are > not the addressee or authorized to receive this for the addressee, you must > not use, copy, disclose or take any action based on this message or any > information herein. If you have received this message in error, please > advise the sender immediately by reply e-mail and delete this message. > Thank you for your cooperation. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Wed Apr 30 19:30:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 30 Apr 2008 19:30:51 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804301028.09307.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> <200804301028.09307.scldad@sdc.com.au> Message-ID: Hi Stephen, I suspect ioctl/TIOCEXCL open/O_EXCL would do the job. Mac uses TIOCEXCL and it is POSIX. We use O_EXCL for lockfiles on Linux already. On Wed, 30 Apr 2008, Stephen Davies wrote: > I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is > the same. > > Any ideas as to how to handle this? > > Stephen > > > On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: >> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: >>> The biggest problem that I have seen with lockfiles on Linux >>> At least is, that it seems there is no standard with respect >>> To the folder in which they should be created. Also, many >>> Distributions seem to set up file system permissions in such >>> A way that writing to the lockfile folder is not allowed for >>> The normal user -- that's why we stopped using lockfiles >>> In our commercial product. >> >> It seems it depends on the expectations. I consider it as a >> feature that by default a linux user cannot access serial ports. >> Maybe root connected a modem (can produce phone bills) or even >> some serial card reader, maybe with the web servers key pair. >> >> I would expect that by default a user cannot open the serial port >> because of insufficient permissions on the device file. I would >> expect this on other unices as well (but I don't know it). >> >> For windows I think it should be similar but not impacting so >> much in practice, because often windows users work with big >> permissions on a somewhat high priviledge level or even >> Administrator. >> >>> If we are to still respect lockfiles, we first need to >>> Understand where we are expected to look for them. Does >>> Anybody have any insight what variants of lockfile folder >>> Schema exist out there in the wild? Some apps like minicom >>> Seem to even allow users to manually specify a lockfile >>> Folder of their choice. >> >> At least my (ancient) minicom does not allow the user to change >> this option, it is displayed but read-only, but root is allowed >> to change it. >> >>> Because of the difficulty finding the right lockfile folder, >>> And because of the inherent risk of thinking that something >>> Might be locked while it actually isn't, I'd suggest that >>> RXTX should have a "soft-off" feature that allows disabling >>> ALL Lockfile checks at runtime without recompiling the native >>> Sharedlibs. >> >> sounds very reasonable, yes... >> and as admin I would not wish that users could skip such >> locking because they do things wrong by default ;) >> >> (in the end I guess that is related to the dilemma, that >> hotplug/user-owned-periphery and multi-user systems simply >> conflict) >> >>> Trent - I like your strategy outline, but I think that it >>> Needs to be configurable by the client such that users and/or >>> Customer Support can disable lockfiles / disable ioctl in >>> Case they detect that they are runing on an OS / Kernal that >>> Does not support one or the other. >> >> Yes, this would be good I guess... Applications could offer >> configuration options to control that, maybe similarily as >> minicom. >> >> BTW, man minicom tells: >> >> *B - Lock file location >> On most systems This should be /usr/spool/uucp. >> Linux systems use /var/lock. If this directory >> does not exist, minicom will not attempt to use >> lockfiles. >> >> The statement `Linux systems use /var/lock' is interesting, does >> anyone know the source of this convention? >> >> oki, >> >> Steffen >> >> About Ingenico Throughout the world businesses rely on Ingenico for secure >> and expedient electronic transaction acceptance. Ingenico products leverage >> proven technology, established standards and unparalleled ergonomics to >> provide optimal reliability, versatility and usability. This comprehensive >> range of products is complemented by a global array of services and >> partnerships, enabling businesses in a number of vertical sectors to accept >> transactions anywhere their business takes them. www.ingenico.com This >> message may contain confidential and/or privileged information. If you are >> not the addressee or authorized to receive this for the addressee, you must >> not use, copy, disclose or take any action based on this message or any >> information herein. If you have received this message in error, please >> advise the sender immediately by reply e-mail and delete this message. >> Thank you for your cooperation. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0057.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0055.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0042.html From pboulton at pulsetracer.com Fri Apr 18 14:30:13 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Fri, 18 Apr 2008 13:30:13 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site Message-ID: <480904D5.1060307@pulsetracer.com> Hello, gentle serial porters. I have downloaded the zipped up binaries for use on Windows without Sun's CommAPI, but don't seem able to extract anything from the download. Go to main page, http://www.rxtx.org/ Click on Downloads I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) And I save it to disk. If I try and extract the files with WinZip, Winzip thinks the archive is corrupt. If I try using Windows Explorer, I am able to extract it into a single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than the original .zip. Any help would be much appreciated. Sincerely, Philip Boulton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080418/97d89793/attachment-0040.html From tjarvi at qbang.org Fri Apr 18 19:07:00 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 18 Apr 2008 19:07:00 -0600 (MDT) Subject: [Rxtx] Difficulty opening zip file at rxtx site In-Reply-To: <480904D5.1060307@pulsetracer.com> References: <480904D5.1060307@pulsetracer.com> Message-ID: On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org From pboulton at pulsetracer.com Sat Apr 19 12:46:26 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Sat, 19 Apr 2008 11:46:26 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site References: <480904D5.1060307@pulsetracer.com> Message-ID: <53DB7576450695419E09299104043761A78533@ZTGSERVER.ztg.local> I have been able to get my hands on the binaries, by going to the ftp directory /pub/rxtx at ftp.qbang.org,, and ftping the file rxtx-2.1-7-bins-r2.zip . This opens happily with Winzip, and extracts as the set of files that you describe below. I only experience the ill-formed archive problem by clicking the link on the rxtx.org Downloads page (http://rxtx.qbang.org/pub/rxtx/ rxtx-2.1-7-bins-r2.zip ). Not sure what to make of that. Philip Boulton ________________________________ From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Fri 4/18/2008 6:07 PM To: Philip Boulton Cc: rxtx at qbang.org Subject: Re: [Rxtx] Difficulty opening zip file at rxtx site On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080419/147923bb/attachment-0039.html From jlar310 at gmail.com Sat Apr 19 19:11:55 2008 From: jlar310 at gmail.com (Jeff Larsen) Date: Sat, 19 Apr 2008 20:11:55 -0500 Subject: [Rxtx] Moxa serial over Ethernet driver Message-ID: Hi all, I've been using javax.comm for years to communicate with a legacy radio data system. We want to migrate the java side of the system to a VMware Server virtual machine. We've had great success using Moxa DE-303 and 5610 serial over Ethernet appliances and virtual machines for running hylafax. The OS (Linux in this case) uses a kernel driver to communicate with the Moxa via a virtual serial port such as /dev/ttyr00. I want to do the same thing with javax.comm or gnu.io to connect to a virtual serial port. However I'm hitting road blocks everywhere. javax.comm for Linux sees the virtual port, but there are transmission errors. Tried Solaris too, but the Solaris Moxa drivers don't play nice with javax.comm because the driver uses /dev/pts/n instead of /dev/term/x. Next I tried RXTX on Linux, but I'm getting NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX on Solaris. Has anyone used RXTX with serial over Ethernet devices? Any hints on how to make it work? I know that I'm not completely off track because javax.comm does work with Moxa on a Windows platform, but that's just not an option for production deployment. -- Jeff From tjarvi at qbang.org Sat Apr 19 21:08:41 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 19 Apr 2008 21:08:41 -0600 (MDT) Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: yOn Sat, 19 Apr 2008, Jeff Larsen wrote: > Hi all, > > I've been using javax.comm for years to communicate with a legacy > radio data system. We want to migrate the java side of the system to a > VMware Server virtual machine. We've had great success using Moxa > DE-303 and 5610 serial over Ethernet appliances and virtual machines > for running hylafax. The OS (Linux in this case) uses a kernel driver > to communicate with the Moxa via a virtual serial port such as > /dev/ttyr00. > > I want to do the same thing with javax.comm or gnu.io to connect to a > virtual serial port. However I'm hitting road blocks everywhere. > javax.comm for Linux sees the virtual port, but there are transmission > errors. Tried Solaris too, but the Solaris Moxa drivers don't play > nice with javax.comm because the driver uses /dev/pts/n instead of > /dev/term/x. Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris. > > Has anyone used RXTX with serial over Ethernet devices? Any hints on > how to make it work? > > I know that I'm not completely off track because javax.comm does work > with Moxa on a Windows platform, but that's just not an option for > production deployment. > > Moxa should work under linux. There may be minor issues depending upon how complete the kernel driver is but I think it will work. One of the minor issues is /dev/ttyr00 is not enumerated. There are several work arounds documented with the source code and on the wiki. The easiest solution for testing purposes is to make a symbolic link from /dev/ttyr00 to a port that is enumerated such as /dev/ttyS129. You can later alter the rxtx source or use properties to change the enumerated ports. -- Trent Jarvi tjarvi at qbang.org From d.tonhofer at m-plify.com Sun Apr 20 03:33:30 2008 From: d.tonhofer at m-plify.com (David Tonhofer (M-PLIFY S.A.)) Date: Sun, 20 Apr 2008 11:33:30 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: <480B0DEA.5010908@m-plify.com> Jeff Larsen wrote: > Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris It might be that the Java side of RXTX does not recognize that portname. Trying modifying src/RXTXCommDriver.java as described in this case: http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card From ajmas at sympatico.ca Sun Apr 20 16:37:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Apr 2008 18:37:59 -0400 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <480B0DEA.5010908@m-plify.com> References: <480B0DEA.5010908@m-plify.com> Message-ID: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > Jeff Larsen wrote: >> Next I tried RXTX on Linux, but I'm getting >> NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX >> on Solaris > It might be that the Java side of RXTX does not recognize that > portname. > Trying modifying src/RXTXCommDriver.java as described in this case: > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card I wonder whether it would be worth allowing custom port prefixes as a system parameter? For example: gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" Andre From Martin.Oberhuber at windriver.com Tue Apr 22 12:34:36 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 22 Apr 2008 20:34:36 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> References: <480B0DEA.5010908@m-plify.com> <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE6485848056CD6CE@ism-mail03.corp.ad.wrs.com> Sounds like a great idea... I'm wondering how the "variable part" after the Prefixes could be specified though? What about allowing Regular Expression character Classes in the existing System Property for specifying ports: System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyS[0-9],ttyS[ABC],ttyUSB[0-9a-z]"); The set of allowed patterns would of course need to Be restricted compared to REGEX, because it must be A syntax that supports iterating over it. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Montag, 21. April 2008 00:38 > To: rxtx at qbang.org and Users > Subject: Re: [Rxtx] Moxa serial over Ethernet driver > > > On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > > Jeff Larsen wrote: > >> Next I tried RXTX on Linux, but I'm getting > >> NoSuchPortException connecting to /dev/ttyr00. I have yet > to try RXTX > >> on Solaris > > It might be that the Java side of RXTX does not recognize that > > portname. > > Trying modifying src/RXTXCommDriver.java as described in this case: > > > > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_ > SST-4P.2FLP_multiport_card > > I wonder whether it would be worth allowing custom port > prefixes as a > system parameter? For > example: > > gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Loi.TRAN at weatherford.com Tue Apr 22 13:10:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Tue, 22 Apr 2008 14:10:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled Message-ID: Hi, I'm currently using the Java RXTX API to interface to a serial port. The serial port is connected to a bridge board that communicates with our communications system running at 1.875 Mbps which is linked to an embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no flow control). I send a command to the embedded board through the serial-bridge board which then is relayed to the embedded board. The command sent asks the embedded board to dump a binary image. Here's where I'm hitting some problems. I've successfully done this is an integrated serial port from the laptop. The binary file that comes back is consistent on every attempt. When I use the application I've written to do the same thing with a USB-to-serial adapter, the image I get back is not the same as the image I receive through the USB-to-serial adapter is not consistent at all. A final thing is that when I use a terminal program to dump the binary image with the USB-serial adapter, the image is correct. Every time! What is the terminal program doing that's not being done in my application? My application is quite simple. Has anyone observed this behavior before? If you have, I'd like to know how you've gotten around this problem. Thanks, LT =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From tjarvi at qbang.org Tue Apr 22 21:11:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 22 Apr 2008 21:11:10 -0600 (MDT) Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org From Loi.TRAN at weatherford.com Wed Apr 23 08:35:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Wed, 23 Apr 2008 09:35:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: Thanks for all the responses. I finally tried something that worked consistently. I updated my Prolific driver and repeated my tests. It worked. If you're using the Prolific type USB-serial adapters, do no use the Prolific version 2.0.2.1 driver on Windows. Update it to the latest 2.0.2.8 version. Again, thanks for all the responses. LT -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Tuesday, April 22, 2008 10:11 PM To: TRAN, Loi X. Cc: rxtx at qbang.org Subject: Re: [Rxtx] Prolific USB - RXTX data mangled On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From Martin.Oberhuber at windriver.com Wed Apr 23 18:54:26 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 02:54:26 +0200 Subject: [Rxtx] RXTX port locking on Linux status? Message-ID: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Dear RXTX community, I'm wondering what the status is with RXTX locking serial ports on Linux? My understanding is that the mechanism used in 2.1-7r2 (lockfiles) is not really state of the art, and has lots of problems (e.g. missing permissions). There was an idea to migrate towards a Kernel syscall based solution for port locking. What's the status here? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/9878db9f/attachment-0035.html From tjarvi at qbang.org Wed Apr 23 20:32:24 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Apr 2008 20:32:24 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > Dear RXTX community, > > I'm wondering what the status is with RXTX locking > serial ports on Linux? > > My understanding is that the mechanism used in > 2.1-7r2 (lockfiles) is not really state of the art, and > has lots of problems (e.g. missing permissions). > > There was an idea to migrate towards a Kernel > syscall based solution for port locking. > > What's the status here? > Hi Martin, I'm in favor of deprecating the current FHS locking mechanism in favor of an IOCTL when available. I think it will be available on all the platforms but do not know for sure. The status is unchanged. I've had very few free cycles for such things. Feel free to take a stab at it if you have some time. I believe the IOCTL is used in the Mac OS X code already. I don't see any real backwards compatability issues and the IOCTL should just work. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Apr 24 06:14:06 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 14:14:06 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Thanks Trent. Problem is only that I'm really not at all Familiar with the C part of RXTX. If there Were anything I could do in Java for this, It would be easier for me.... ... Are there any C experts here on the list Who'd like to look at ioctl port locking For linux? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Donnerstag, 24. April 2008 04:32 > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > I'm wondering what the status is with RXTX locking > > serial ports on Linux? > > > > My understanding is that the mechanism used in > > 2.1-7r2 (lockfiles) is not really state of the art, and > > has lots of problems (e.g. missing permissions). > > > > There was an idea to migrate towards a Kernel > > syscall based solution for port locking. > > > > What's the status here? > > > > Hi Martin, > > I'm in favor of deprecating the current FHS locking mechanism > in favor of > an IOCTL when available. I think it will be available on all the > platforms but do not know for sure. > > The status is unchanged. I've had very few free cycles for > such things. > Feel free to take a stab at it if you have some time. I > believe the IOCTL > is used in the Mac OS X code already. > > I don't see any real backwards compatability issues and the > IOCTL should > just work. > > -- > Trent Jarvi > tjarvi at qbang.org > From sspies at sloc.de Thu Apr 24 07:15:36 2008 From: sspies at sloc.de (Sebastian Spies) Date: Thu, 24 Apr 2008 15:15:36 +0200 (CEST) Subject: [Rxtx] rxtx on gumstix: Interrupted system call In-Reply-To: <47FB7B20.7080504@sloc.de> References: <47FB7B20.7080504@sloc.de> Message-ID: <55445.130.83.139.205.1209042936.squirrel@ssl.sloc.de> Dear list, while porting rxtx to the gumstix, I found out, that select used in readArray in SerialImp.c might not work as expected. Maybe, because of missing TIOCSERGETLSR-support? select is often interrupted, so i wrote the following quick'n'dirty hack to make it work on gumstix: diff -Nur rxtx-2.1-7r2/src/SerialImp.c rxtx-2.1-7r2/src/SerialImp.c --- rxtx-2.1-7r2/src/SerialImp.c 2006-01-29 23:19:04.000000000 +0100 +++ rxtx-2.1-7r2-patched/src/SerialImp.c 2008-04-24 14:30:17.000000000 +0200 @@ -3380,7 +3381,7 @@ JNIEXPORT jint JNICALL RXTXPort(readArray)( JNIEnv *env, jobject jobj, jbyteArray jbarray, jint offset, jint length ) { - int bytes; + int bytes = 0; jbyte *body; /* char msg[80]; */ int fd = get_java_var( env, jobj, "fd", "I" ); @@ -3397,9 +3398,18 @@ "readArray", "Invalid length" ); return -1; } - body = (*env)->GetByteArrayElements( env, jbarray, 0 ); - bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ - (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + while(1 > bytes) + { + body = (*env)->GetByteArrayElements( env, jbarray, 0 ); + bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ + (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + // quick'n'dirty - SSP + report (" trying again... \n"); + errno = 0; + } + if( bytes < 0 ) { report( "RXTXPort:readArray bytes < 0" ); LEAVE( "RXTXPort:readArray" ); > Hey, > > I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use > RXTXPort$SerialInputStream.read(), then I get the following Exception. I > did not yet figure out which system call is interrupted as strace > produces loads of output. > > Any help would be very appreciated. Thanks in advance. > Sebastian > > > [java] java.io.IOException: Interrupted system call in readArray > [java] at gnu.io.RXTXPort.readArray(Native Method) > [java] at > gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) > [java] at > java.io.FilterInputStream.read(FilterInputStream.java:189) > [java] at > java.io.BufferedInputStream.refill(BufferedInputStream.java:371) > [java] at > java.io.BufferedInputStream.read(BufferedInputStream.java:229) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) > [java] at > com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) > > -- > Sebastian Spies > > mail: sspies at sloc.de > > > > From fire_baptized at hotmail.com Thu Apr 24 18:27:48 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Thu, 24 Apr 2008 20:27:48 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hello I am having a problem with the serial device connecting (software wise) to the serial port. However I have a test program and it seems to work just fine in that environment - and it doesnt use GUI. The error I am getting is : PortNotFoundException Now the way I have it setup in the GUI environment is that once the user pushes a JButton the program connects using this class: protected void establishConnection() { try { portId = CommPortIdentifier.getPortIdentifier("COM3"); System.out.println("Establishing connction....."); messages[0] = "\nEstablishing connction.....\n"; } catch ( NoSuchPortException noport) { System.out.println("Port not found: "+ noport); messages[0] = "Port not found: "+ noport+"\n"; } try { serialPort = (SerialPort) portId.open("serial", 50); System.out.println("Port has been found."); messages[1] = "Port has been found.\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[1] = "" +usedport; } try { serialPort = (SerialPort) portId.open("serial", 50); messages[2] = "Connecting to COM3 on port 50....\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; } try { serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); System.out.println("Esablishing the transfer rate settings for COM3."); messages[3] = "Esablishing the transfer rate settings for COM3.\n"; } catch (UnsupportedCommOperationException nosupcom) { System.out.println(nosupcom); System.out.println("The tranfer rate could not be esblished on COM3."); messages[3] = "The tranfer rate could not be esblished on COM3.\n"; } System.out.println(serialPort.getFlowControlMode()); messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; //sendDataOut(buffer[3],buffer[4]); } I need all the data in this method (and all the string values in this method) to be printed out on a JTextArea. I wont do me any good if not all the text is printed on a JTextArea in another class. So I have the text printing the JTextArea correctly, but everytime the JButton is activated - it gives me that error message. I did add a disconnect button that is supposed to call the serialPort.close(). _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/273fd4ec/attachment-0034.html From tjarvi at qbang.org Thu Apr 24 21:54:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Apr 2008 21:54:10 -0600 (MDT) Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > Hello I am having a problem with the serial device connecting (software > wise) to the serial port. However I have a test program and it seems to > work just fine in that environment - and it doesnt use GUI. The error I > am getting is : PortNotFoundException Now the way I have it setup in the > GUI environment is that once the user pushes a JButton the program > connects using this class: > > protected void establishConnection() { > try { > portId = CommPortIdentifier.getPortIdentifier("COM3"); > System.out.println("Establishing connction....."); > messages[0] = "\nEstablishing connction.....\n"; > } > catch ( NoSuchPortException noport) { > System.out.println("Port not found: "+ noport); > messages[0] = "Port not found: "+ noport+"\n"; > } > try { > serialPort = (SerialPort) portId.open("serial", 50); > System.out.println("Port has been found."); > messages[1] = "Port has been found.\n"; > } > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[1] = "" +usedport; > } ================================================================= > try { > serialPort = (SerialPort) portId.open("serial", 50); > messages[2] = "Connecting to COM3 on port 50....\n"; > } ================================================================== > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > } > try { > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > System.out.println("Esablishing the transfer rate settings for COM3."); > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > } > catch (UnsupportedCommOperationException nosupcom) { > System.out.println(nosupcom); > System.out.println("The tranfer rate could not be esblished on COM3."); > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > } > System.out.println(serialPort.getFlowControlMode()); > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > //sendDataOut(buffer[3],buffer[4]); > } > > I need all the data in this method (and all the string values in this > method) to be printed out on a JTextArea. I wont do me any good if not > all the text is printed on a JTextArea in another class. So I have the > text printing the JTextArea correctly, but everytime the JButton is > activated - it gives me that error message. I did add a disconnect > button that is supposed to call the serialPort.close(). > The open code used twice is going to throw an exception. It may be that you catch the exception above this code and print a confusing message? A common mistake is people will accidently run two copies of their program. The first instance of the program will open the port and prevent enumeration (finding the port) in the second instance of the program. As an example, you may be running your text based application which is preventing the GUI from seeing the port. Enumeration is done by trying to open the port. If the port is open, Enumeration fails. -- Trent Jarvi tjarvi at qbang.org From fire_baptized at hotmail.com Thu Apr 24 22:32:05 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 00:32:05 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Wow - thanks dude what a dumb thing for me to not catch..... now here is the current problem - right now I am trying to output data again one is with the test program - and it seems that serialPort.setRTS(true); is throwing an exceptions there - now if I show this code please bare in mind that I am only testing - the code is kinda sloppy in my mind - but if I can figure out why calling this function is throwing an exception then maybe I can figure out why my GUI application is getting the same null pointer exceptions when try to send out the data stream. FYI Trent this email is not directed towards you - anyone can jump in on this public static void main(String args[]) { byte[] b = new byte[64]; int keyinput = 0 ; byte x = 0; byte y = 0; PortTesting1 testports = new PortTesting1(); try { joyskoro = Joystick.createInstance(); } catch (IOException ioexc) { System.out.println("There is an input/output problem: " + ioexc); } while (true) { joyskoro.poll(); b[0] = ((byte) -(10 * joyskoro.getY())); b[1] = ((byte) (10 * joyskoro.getX())); System.out.println("The 3rd byte is: " +b[0]); System.out.println("The 4rd byte is: " +b[1]); serialPort.setRTS(true); // HERE IS WHERE THE PROBLEM IS !!!!!!! ON THIS LINE but if I dont have it active in my program the Bluetooth device (that is System.out.println("Ready to send :-) !"); //connected to the serial port does not send out data!!!!! if (joyskoro.isButtonDown(joyskoro.BUTTON10)) { System.out.println("Connection terminated."); serialPort.close(); break; } if (joyskoro.isButtonDown(joyskoro.BUTTON2)) { boolean flag = true; //reading from key input from the keyboard System.out.println("Please input a command: "); while (flag) { try { keyinput = System.in.read(); } catch (IOException ioexc) {/*there is no need to put * anything here */ } if((char)keyinput=='w') { pushIt((byte)85); } if((char)keyinput=='s') { pushIt((byte)84); } if((char)keyinput=='a') { pushIt((byte)83); } if((char)keyinput=='d') { pushIt((byte)82); } if((char)keyinput=='q') { pushIt((byte)89); } if((char)keyinput=='\t') { //this stop reading input from the keyboard flag = false; } } and help anyways here is the block of code that throwing an exception for the test program: > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/5c8f7d68/attachment-0034.html From fire_baptized at hotmail.com Fri Apr 25 07:59:53 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 09:59:53 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Are there any examples of how to push out data? As in using input and output streams - if I can compare code maybe I can see where this is causing a problem. I have a byte array that I am pushing out data. I keep getting null pointer exceptions every where I turn. > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/22228ab6/attachment-0033.html From ajmas at sympatico.ca Sat Apr 26 07:37:09 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 26 Apr 2008 09:37:09 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hi, On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote: > > Are there any examples of how to push out data? As in using input > and output streams - if I can compare code maybe I can see where > this is causing a problem. I have a byte array that I am pushing > out data. I keep getting null pointer exceptions every where I turn. > There are some examples here that might be of help: http://rxtx.qbang.org/wiki/index.php/Examples Andre From fire_baptized at hotmail.com Sat Apr 26 20:13:54 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Sat, 26 Apr 2008 22:13:54 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: looked at those....yep didnt help - I need to push out data with GUI and not get a null pointer exception everytime I try. > CC: rxtx at qbang.org> From: ajmas at sympatico.ca> To: fire_baptized at hotmail.com> Subject: Re: [Rxtx] Serial Problems with Gui.....> Date: Sat, 26 Apr 2008 09:37:09 -0400> > Hi,> > > On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote:> >> > Are there any examples of how to push out data? As in using input > > and output streams - if I can compare code maybe I can see where > > this is causing a problem. I have a byte array that I am pushing > > out data. I keep getting null pointer exceptions every where I turn.> >> > There are some examples here that might be of help:> > http://rxtx.qbang.org/wiki/index.php/Examples> > Andre _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080426/09f95b41/attachment-0032.html From michael.erskine at ketech.com Mon Apr 28 02:47:22 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 28 Apr 2008 09:47:22 +0100 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D426EF3CBBC5@no-sv-03.ketech.local> Jesrael D. Summerhill wrote: > looked at those....yep didnt help - I need to push out data with GUI and > not get a null pointer exception everytime I try. So it seems pretty obvious that your code needs to check for nulls wherever one may occur and report what's happening. Alternatively, catch the npe and display the stack trace. Then you can fix your code so it doesn't try to work with something that ain't there. Regards, Michael Erskine. From scldad at sdc.com.au Mon Apr 28 03:58:34 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Mon, 28 Apr 2008 19:28:34 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Message-ID: <200804281928.34454.scldad@sdc.com.au> Has anybody done any design work on this? The first thing that springs to mind is that we still need to check for lock files because other apps tend to use that approach even if we go to ioctl. Cheers, Stephen Davies On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > Thanks Trent. > > Problem is only that I'm really not at all > Familiar with the C part of RXTX. If there > Were anything I could do in Java for this, > It would be easier for me.... > > ... Are there any C experts here on the list > Who'd like to look at ioctl port locking > For linux? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > -----Original Message----- > > From: Trent Jarvi [mailto:tjarvi at qbang.org] > > Sent: Donnerstag, 24. April 2008 04:32 > > To: Oberhuber, Martin > > Cc: rxtx at qbang.org > > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > > > I'm wondering what the status is with RXTX locking > > > serial ports on Linux? > > > > > > My understanding is that the mechanism used in > > > 2.1-7r2 (lockfiles) is not really state of the art, and > > > has lots of problems (e.g. missing permissions). > > > > > > There was an idea to migrate towards a Kernel > > > syscall based solution for port locking. > > > > > > What's the status here? > > > > Hi Martin, > > > > I'm in favor of deprecating the current FHS locking mechanism > > in favor of > > an IOCTL when available. I think it will be available on all the > > platforms but do not know for sure. > > > > The status is unchanged. I've had very few free cycles for > > such things. > > Feel free to take a stab at it if you have some time. I > > believe the IOCTL > > is used in the Mac OS X code already. > > > > I don't see any real backwards compatability issues and the > > IOCTL should > > just work. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Mon Apr 28 04:21:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 28 Apr 2008 04:21:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804281928.34454.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: I don't think there would need to be any architectural changes. A couple ifdefs and minor changes in the current code should be enough. Proposal: FHS/UUCP locks: continue to respect them, try to create them but do not error if the IOCTL is supported. (But does the IOCTL being defined mean it will work?) Enumeration: Do not assert the IOCTL while opening. Serial.open: assert the IOCTL after open. Continue to use locks as described above after asserting the IOCTL. If the IOCTL is defined but not working, handle it here. Failure cases include the IOCTL is not supported and the port is already locked. On Mon, 28 Apr 2008, Stephen Davies wrote: > Has anybody done any design work on this? > The first thing that springs to mind is that we still need to check for lock > files because other apps tend to use that approach even if we go to ioctl. > > Cheers, > Stephen Davies > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: >> Thanks Trent. >> >> Problem is only that I'm really not at all >> Familiar with the C part of RXTX. If there >> Were anything I could do in Java for this, >> It would be easier for me.... >> >> ... Are there any C experts here on the list >> Who'd like to look at ioctl port locking >> For linux? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >>> -----Original Message----- >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] >>> Sent: Donnerstag, 24. April 2008 04:32 >>> To: Oberhuber, Martin >>> Cc: rxtx at qbang.org >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? >>> >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: >>>> Dear RXTX community, >>>> >>>> I'm wondering what the status is with RXTX locking >>>> serial ports on Linux? >>>> >>>> My understanding is that the mechanism used in >>>> 2.1-7r2 (lockfiles) is not really state of the art, and >>>> has lots of problems (e.g. missing permissions). >>>> >>>> There was an idea to migrate towards a Kernel >>>> syscall based solution for port locking. >>>> >>>> What's the status here? >>> >>> Hi Martin, >>> >>> I'm in favor of deprecating the current FHS locking mechanism >>> in favor of >>> an IOCTL when available. I think it will be available on all the >>> platforms but do not know for sure. >>> >>> The status is unchanged. I've had very few free cycles for >>> such things. >>> Feel free to take a stab at it if you have some time. I >>> believe the IOCTL >>> is used in the Mac OS X code already. >>> >>> I don't see any real backwards compatability issues and the >>> IOCTL should >>> just work. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Tue Apr 29 12:04:04 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Apr 2008 20:04:04 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Hi all, The biggest problem that I have seen with lockfiles on Linux At least is, that it seems there is no standard with respect To the folder in which they should be created. Also, many Distributions seem to set up file system permissions in such A way that writing to the lockfile folder is not allowed for The normal user -- that's why we stopped using lockfiles In our commercial product. If we are to still respect lockfiles, we first need to Understand where we are expected to look for them. Does Anybody have any insight what variants of lockfile folder Schema exist out there in the wild? Some apps like minicom Seem to even allow users to manually specify a lockfile Folder of their choice. Because of the difficulty finding the right lockfile folder, And because of the inherent risk of thinking that something Might be locked while it actually isn't, I'd suggest that RXTX should have a "soft-off" feature that allows disabling ALL Lockfile checks at runtime without recompiling the native Sharedlibs. Trent - I like your strategy outline, but I think that it Needs to be configurable by the client such that users and/or Customer Support can disable lockfiles / disable ioctl in Case they detect that they are runing on an OS / Kernal that Does not support one or the other. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Montag, 28. April 2008 12:22 > To: Stephen Davies > Cc: rxtx at qbang.org; Oberhuber, Martin; Trent Jarvi > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > I don't think there would need to be any architectural > changes. A couple > ifdefs and minor changes in the current code should be enough. > > Proposal: > > FHS/UUCP locks: > continue to respect them, try to create them but do not error if > the IOCTL is supported. (But does the IOCTL being defined mean > it will work?) > Enumeration: > Do not assert the IOCTL while opening. > Serial.open: > assert the IOCTL after open. Continue to use locks as described > above after asserting the IOCTL. If the IOCTL is defined but > not working, handle it here. Failure cases include the IOCTL > is not supported and the port is already locked. > > On Mon, 28 Apr 2008, Stephen Davies wrote: > > > Has anybody done any design work on this? > > The first thing that springs to mind is that we still need > to check for lock > > files because other apps tend to use that approach even if > we go to ioctl. > > > > Cheers, > > Stephen Davies > > > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > >> Thanks Trent. > >> > >> Problem is only that I'm really not at all > >> Familiar with the C part of RXTX. If there > >> Were anything I could do in Java for this, > >> It would be easier for me.... > >> > >> ... Are there any C experts here on the list > >> Who'd like to look at ioctl port locking > >> For linux? > >> > >> Thanks, > >> -- > >> Martin Oberhuber, Senior Member of Technical Staff, Wind River > >> Target Management Project Lead, DSDP PMC Member > >> http://www.eclipse.org/dsdp/tm > >> > >>> -----Original Message----- > >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] > >>> Sent: Donnerstag, 24. April 2008 04:32 > >>> To: Oberhuber, Martin > >>> Cc: rxtx at qbang.org > >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? > >>> > >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > >>>> Dear RXTX community, > >>>> > >>>> I'm wondering what the status is with RXTX locking > >>>> serial ports on Linux? > >>>> > >>>> My understanding is that the mechanism used in > >>>> 2.1-7r2 (lockfiles) is not really state of the art, and > >>>> has lots of problems (e.g. missing permissions). > >>>> > >>>> There was an idea to migrate towards a Kernel > >>>> syscall based solution for port locking. > >>>> > >>>> What's the status here? > >>> > >>> Hi Martin, > >>> > >>> I'm in favor of deprecating the current FHS locking mechanism > >>> in favor of > >>> an IOCTL when available. I think it will be available on all the > >>> platforms but do not know for sure. > >>> > >>> The status is unchanged. I've had very few free cycles for > >>> such things. > >>> Feel free to take a stab at it if you have some time. I > >>> believe the IOCTL > >>> is used in the Mac OS X code already. > >>> > >>> I don't see any real backwards compatability issues and the > >>> IOCTL should > >>> just work. > >>> > >>> -- > >>> Trent Jarvi > >>> tjarvi at qbang.org > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > From Steffen.DETTMER at ingenico.com Tue Apr 29 13:34:44 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 29 Apr 2008 21:34:44 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Message-ID: <20080429193444.GU2928@elberon.bln.de.ingenico.com> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > The biggest problem that I have seen with lockfiles on Linux > At least is, that it seems there is no standard with respect > To the folder in which they should be created. Also, many > Distributions seem to set up file system permissions in such > A way that writing to the lockfile folder is not allowed for > The normal user -- that's why we stopped using lockfiles > In our commercial product. It seems it depends on the expectations. I consider it as a feature that by default a linux user cannot access serial ports. Maybe root connected a modem (can produce phone bills) or even some serial card reader, maybe with the web servers key pair. I would expect that by default a user cannot open the serial port because of insufficient permissions on the device file. I would expect this on other unices as well (but I don't know it). For windows I think it should be similar but not impacting so much in practice, because often windows users work with big permissions on a somewhat high priviledge level or even Administrator. > If we are to still respect lockfiles, we first need to > Understand where we are expected to look for them. Does > Anybody have any insight what variants of lockfile folder > Schema exist out there in the wild? Some apps like minicom > Seem to even allow users to manually specify a lockfile > Folder of their choice. At least my (ancient) minicom does not allow the user to change this option, it is displayed but read-only, but root is allowed to change it. > Because of the difficulty finding the right lockfile folder, > And because of the inherent risk of thinking that something > Might be locked while it actually isn't, I'd suggest that > RXTX should have a "soft-off" feature that allows disabling > ALL Lockfile checks at runtime without recompiling the native > Sharedlibs. sounds very reasonable, yes... and as admin I would not wish that users could skip such locking because they do things wrong by default ;) (in the end I guess that is related to the dilemma, that hotplug/user-owned-periphery and multi-user systems simply conflict) > Trent - I like your strategy outline, but I think that it > Needs to be configurable by the client such that users and/or > Customer Support can disable lockfiles / disable ioctl in > Case they detect that they are runing on an OS / Kernal that > Does not support one or the other. Yes, this would be good I guess... Applications could offer configuration options to control that, maybe similarily as minicom. BTW, man minicom tells: *B - Lock file location On most systems This should be /usr/spool/uucp. Linux systems use /var/lock. If this directory does not exist, minicom will not attempt to use lockfiles. The statement `Linux systems use /var/lock' is interesting, does anyone know the source of this convention? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Tue Apr 29 16:11:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Apr 2008 16:11:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? These details are outlined in the Filesystem Hierarchy Standard (FHS). http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLOCKLOCKFILES -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Tue Apr 29 18:58:09 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Wed, 30 Apr 2008 10:28:09 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: <200804301028.09307.scldad@sdc.com.au> I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is the same. Any ideas as to how to handle this? Stephen On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: > * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > > The biggest problem that I have seen with lockfiles on Linux > > At least is, that it seems there is no standard with respect > > To the folder in which they should be created. Also, many > > Distributions seem to set up file system permissions in such > > A way that writing to the lockfile folder is not allowed for > > The normal user -- that's why we stopped using lockfiles > > In our commercial product. > > It seems it depends on the expectations. I consider it as a > feature that by default a linux user cannot access serial ports. > Maybe root connected a modem (can produce phone bills) or even > some serial card reader, maybe with the web servers key pair. > > I would expect that by default a user cannot open the serial port > because of insufficient permissions on the device file. I would > expect this on other unices as well (but I don't know it). > > For windows I think it should be similar but not impacting so > much in practice, because often windows users work with big > permissions on a somewhat high priviledge level or even > Administrator. > > > If we are to still respect lockfiles, we first need to > > Understand where we are expected to look for them. Does > > Anybody have any insight what variants of lockfile folder > > Schema exist out there in the wild? Some apps like minicom > > Seem to even allow users to manually specify a lockfile > > Folder of their choice. > > At least my (ancient) minicom does not allow the user to change > this option, it is displayed but read-only, but root is allowed > to change it. > > > Because of the difficulty finding the right lockfile folder, > > And because of the inherent risk of thinking that something > > Might be locked while it actually isn't, I'd suggest that > > RXTX should have a "soft-off" feature that allows disabling > > ALL Lockfile checks at runtime without recompiling the native > > Sharedlibs. > > sounds very reasonable, yes... > and as admin I would not wish that users could skip such > locking because they do things wrong by default ;) > > (in the end I guess that is related to the dilemma, that > hotplug/user-owned-periphery and multi-user systems simply > conflict) > > > Trent - I like your strategy outline, but I think that it > > Needs to be configurable by the client such that users and/or > > Customer Support can disable lockfiles / disable ioctl in > > Case they detect that they are runing on an OS / Kernal that > > Does not support one or the other. > > Yes, this would be good I guess... Applications could offer > configuration options to control that, maybe similarily as > minicom. > > BTW, man minicom tells: > > *B - Lock file location > On most systems This should be /usr/spool/uucp. > Linux systems use /var/lock. If this directory > does not exist, minicom will not attempt to use > lockfiles. > > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure > and expedient electronic transaction acceptance. Ingenico products leverage > proven technology, established standards and unparalleled ergonomics to > provide optimal reliability, versatility and usability. This comprehensive > range of products is complemented by a global array of services and > partnerships, enabling businesses in a number of vertical sectors to accept > transactions anywhere their business takes them. www.ingenico.com This > message may contain confidential and/or privileged information. If you are > not the addressee or authorized to receive this for the addressee, you must > not use, copy, disclose or take any action based on this message or any > information herein. If you have received this message in error, please > advise the sender immediately by reply e-mail and delete this message. > Thank you for your cooperation. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Wed Apr 30 19:30:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 30 Apr 2008 19:30:51 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804301028.09307.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> <200804301028.09307.scldad@sdc.com.au> Message-ID: Hi Stephen, I suspect ioctl/TIOCEXCL open/O_EXCL would do the job. Mac uses TIOCEXCL and it is POSIX. We use O_EXCL for lockfiles on Linux already. On Wed, 30 Apr 2008, Stephen Davies wrote: > I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is > the same. > > Any ideas as to how to handle this? > > Stephen > > > On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: >> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: >>> The biggest problem that I have seen with lockfiles on Linux >>> At least is, that it seems there is no standard with respect >>> To the folder in which they should be created. Also, many >>> Distributions seem to set up file system permissions in such >>> A way that writing to the lockfile folder is not allowed for >>> The normal user -- that's why we stopped using lockfiles >>> In our commercial product. >> >> It seems it depends on the expectations. I consider it as a >> feature that by default a linux user cannot access serial ports. >> Maybe root connected a modem (can produce phone bills) or even >> some serial card reader, maybe with the web servers key pair. >> >> I would expect that by default a user cannot open the serial port >> because of insufficient permissions on the device file. I would >> expect this on other unices as well (but I don't know it). >> >> For windows I think it should be similar but not impacting so >> much in practice, because often windows users work with big >> permissions on a somewhat high priviledge level or even >> Administrator. >> >>> If we are to still respect lockfiles, we first need to >>> Understand where we are expected to look for them. Does >>> Anybody have any insight what variants of lockfile folder >>> Schema exist out there in the wild? Some apps like minicom >>> Seem to even allow users to manually specify a lockfile >>> Folder of their choice. >> >> At least my (ancient) minicom does not allow the user to change >> this option, it is displayed but read-only, but root is allowed >> to change it. >> >>> Because of the difficulty finding the right lockfile folder, >>> And because of the inherent risk of thinking that something >>> Might be locked while it actually isn't, I'd suggest that >>> RXTX should have a "soft-off" feature that allows disabling >>> ALL Lockfile checks at runtime without recompiling the native >>> Sharedlibs. >> >> sounds very reasonable, yes... >> and as admin I would not wish that users could skip such >> locking because they do things wrong by default ;) >> >> (in the end I guess that is related to the dilemma, that >> hotplug/user-owned-periphery and multi-user systems simply >> conflict) >> >>> Trent - I like your strategy outline, but I think that it >>> Needs to be configurable by the client such that users and/or >>> Customer Support can disable lockfiles / disable ioctl in >>> Case they detect that they are runing on an OS / Kernal that >>> Does not support one or the other. >> >> Yes, this would be good I guess... Applications could offer >> configuration options to control that, maybe similarily as >> minicom. >> >> BTW, man minicom tells: >> >> *B - Lock file location >> On most systems This should be /usr/spool/uucp. >> Linux systems use /var/lock. If this directory >> does not exist, minicom will not attempt to use >> lockfiles. >> >> The statement `Linux systems use /var/lock' is interesting, does >> anyone know the source of this convention? >> >> oki, >> >> Steffen >> >> About Ingenico Throughout the world businesses rely on Ingenico for secure >> and expedient electronic transaction acceptance. Ingenico products leverage >> proven technology, established standards and unparalleled ergonomics to >> provide optimal reliability, versatility and usability. This comprehensive >> range of products is complemented by a global array of services and >> partnerships, enabling businesses in a number of vertical sectors to accept >> transactions anywhere their business takes them. www.ingenico.com This >> message may contain confidential and/or privileged information. If you are >> not the addressee or authorized to receive this for the addressee, you must >> not use, copy, disclose or take any action based on this message or any >> information herein. If you have received this message in error, please >> advise the sender immediately by reply e-mail and delete this message. >> Thank you for your cooperation. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0058.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0056.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0043.html From pboulton at pulsetracer.com Fri Apr 18 14:30:13 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Fri, 18 Apr 2008 13:30:13 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site Message-ID: <480904D5.1060307@pulsetracer.com> Hello, gentle serial porters. I have downloaded the zipped up binaries for use on Windows without Sun's CommAPI, but don't seem able to extract anything from the download. Go to main page, http://www.rxtx.org/ Click on Downloads I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) And I save it to disk. If I try and extract the files with WinZip, Winzip thinks the archive is corrupt. If I try using Windows Explorer, I am able to extract it into a single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than the original .zip. Any help would be much appreciated. Sincerely, Philip Boulton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080418/97d89793/attachment-0041.html From tjarvi at qbang.org Fri Apr 18 19:07:00 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 18 Apr 2008 19:07:00 -0600 (MDT) Subject: [Rxtx] Difficulty opening zip file at rxtx site In-Reply-To: <480904D5.1060307@pulsetracer.com> References: <480904D5.1060307@pulsetracer.com> Message-ID: On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org From pboulton at pulsetracer.com Sat Apr 19 12:46:26 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Sat, 19 Apr 2008 11:46:26 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site References: <480904D5.1060307@pulsetracer.com> Message-ID: <53DB7576450695419E09299104043761A78533@ZTGSERVER.ztg.local> I have been able to get my hands on the binaries, by going to the ftp directory /pub/rxtx at ftp.qbang.org,, and ftping the file rxtx-2.1-7-bins-r2.zip . This opens happily with Winzip, and extracts as the set of files that you describe below. I only experience the ill-formed archive problem by clicking the link on the rxtx.org Downloads page (http://rxtx.qbang.org/pub/rxtx/ rxtx-2.1-7-bins-r2.zip ). Not sure what to make of that. Philip Boulton ________________________________ From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Fri 4/18/2008 6:07 PM To: Philip Boulton Cc: rxtx at qbang.org Subject: Re: [Rxtx] Difficulty opening zip file at rxtx site On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080419/147923bb/attachment-0040.html From jlar310 at gmail.com Sat Apr 19 19:11:55 2008 From: jlar310 at gmail.com (Jeff Larsen) Date: Sat, 19 Apr 2008 20:11:55 -0500 Subject: [Rxtx] Moxa serial over Ethernet driver Message-ID: Hi all, I've been using javax.comm for years to communicate with a legacy radio data system. We want to migrate the java side of the system to a VMware Server virtual machine. We've had great success using Moxa DE-303 and 5610 serial over Ethernet appliances and virtual machines for running hylafax. The OS (Linux in this case) uses a kernel driver to communicate with the Moxa via a virtual serial port such as /dev/ttyr00. I want to do the same thing with javax.comm or gnu.io to connect to a virtual serial port. However I'm hitting road blocks everywhere. javax.comm for Linux sees the virtual port, but there are transmission errors. Tried Solaris too, but the Solaris Moxa drivers don't play nice with javax.comm because the driver uses /dev/pts/n instead of /dev/term/x. Next I tried RXTX on Linux, but I'm getting NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX on Solaris. Has anyone used RXTX with serial over Ethernet devices? Any hints on how to make it work? I know that I'm not completely off track because javax.comm does work with Moxa on a Windows platform, but that's just not an option for production deployment. -- Jeff From tjarvi at qbang.org Sat Apr 19 21:08:41 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 19 Apr 2008 21:08:41 -0600 (MDT) Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: yOn Sat, 19 Apr 2008, Jeff Larsen wrote: > Hi all, > > I've been using javax.comm for years to communicate with a legacy > radio data system. We want to migrate the java side of the system to a > VMware Server virtual machine. We've had great success using Moxa > DE-303 and 5610 serial over Ethernet appliances and virtual machines > for running hylafax. The OS (Linux in this case) uses a kernel driver > to communicate with the Moxa via a virtual serial port such as > /dev/ttyr00. > > I want to do the same thing with javax.comm or gnu.io to connect to a > virtual serial port. However I'm hitting road blocks everywhere. > javax.comm for Linux sees the virtual port, but there are transmission > errors. Tried Solaris too, but the Solaris Moxa drivers don't play > nice with javax.comm because the driver uses /dev/pts/n instead of > /dev/term/x. Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris. > > Has anyone used RXTX with serial over Ethernet devices? Any hints on > how to make it work? > > I know that I'm not completely off track because javax.comm does work > with Moxa on a Windows platform, but that's just not an option for > production deployment. > > Moxa should work under linux. There may be minor issues depending upon how complete the kernel driver is but I think it will work. One of the minor issues is /dev/ttyr00 is not enumerated. There are several work arounds documented with the source code and on the wiki. The easiest solution for testing purposes is to make a symbolic link from /dev/ttyr00 to a port that is enumerated such as /dev/ttyS129. You can later alter the rxtx source or use properties to change the enumerated ports. -- Trent Jarvi tjarvi at qbang.org From d.tonhofer at m-plify.com Sun Apr 20 03:33:30 2008 From: d.tonhofer at m-plify.com (David Tonhofer (M-PLIFY S.A.)) Date: Sun, 20 Apr 2008 11:33:30 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: <480B0DEA.5010908@m-plify.com> Jeff Larsen wrote: > Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris It might be that the Java side of RXTX does not recognize that portname. Trying modifying src/RXTXCommDriver.java as described in this case: http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card From ajmas at sympatico.ca Sun Apr 20 16:37:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Apr 2008 18:37:59 -0400 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <480B0DEA.5010908@m-plify.com> References: <480B0DEA.5010908@m-plify.com> Message-ID: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > Jeff Larsen wrote: >> Next I tried RXTX on Linux, but I'm getting >> NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX >> on Solaris > It might be that the Java side of RXTX does not recognize that > portname. > Trying modifying src/RXTXCommDriver.java as described in this case: > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card I wonder whether it would be worth allowing custom port prefixes as a system parameter? For example: gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" Andre From Martin.Oberhuber at windriver.com Tue Apr 22 12:34:36 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 22 Apr 2008 20:34:36 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> References: <480B0DEA.5010908@m-plify.com> <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE6485848056CD6CE@ism-mail03.corp.ad.wrs.com> Sounds like a great idea... I'm wondering how the "variable part" after the Prefixes could be specified though? What about allowing Regular Expression character Classes in the existing System Property for specifying ports: System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyS[0-9],ttyS[ABC],ttyUSB[0-9a-z]"); The set of allowed patterns would of course need to Be restricted compared to REGEX, because it must be A syntax that supports iterating over it. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Montag, 21. April 2008 00:38 > To: rxtx at qbang.org and Users > Subject: Re: [Rxtx] Moxa serial over Ethernet driver > > > On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > > Jeff Larsen wrote: > >> Next I tried RXTX on Linux, but I'm getting > >> NoSuchPortException connecting to /dev/ttyr00. I have yet > to try RXTX > >> on Solaris > > It might be that the Java side of RXTX does not recognize that > > portname. > > Trying modifying src/RXTXCommDriver.java as described in this case: > > > > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_ > SST-4P.2FLP_multiport_card > > I wonder whether it would be worth allowing custom port > prefixes as a > system parameter? For > example: > > gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Loi.TRAN at weatherford.com Tue Apr 22 13:10:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Tue, 22 Apr 2008 14:10:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled Message-ID: Hi, I'm currently using the Java RXTX API to interface to a serial port. The serial port is connected to a bridge board that communicates with our communications system running at 1.875 Mbps which is linked to an embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no flow control). I send a command to the embedded board through the serial-bridge board which then is relayed to the embedded board. The command sent asks the embedded board to dump a binary image. Here's where I'm hitting some problems. I've successfully done this is an integrated serial port from the laptop. The binary file that comes back is consistent on every attempt. When I use the application I've written to do the same thing with a USB-to-serial adapter, the image I get back is not the same as the image I receive through the USB-to-serial adapter is not consistent at all. A final thing is that when I use a terminal program to dump the binary image with the USB-serial adapter, the image is correct. Every time! What is the terminal program doing that's not being done in my application? My application is quite simple. Has anyone observed this behavior before? If you have, I'd like to know how you've gotten around this problem. Thanks, LT =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From tjarvi at qbang.org Tue Apr 22 21:11:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 22 Apr 2008 21:11:10 -0600 (MDT) Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org From Loi.TRAN at weatherford.com Wed Apr 23 08:35:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Wed, 23 Apr 2008 09:35:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: Thanks for all the responses. I finally tried something that worked consistently. I updated my Prolific driver and repeated my tests. It worked. If you're using the Prolific type USB-serial adapters, do no use the Prolific version 2.0.2.1 driver on Windows. Update it to the latest 2.0.2.8 version. Again, thanks for all the responses. LT -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Tuesday, April 22, 2008 10:11 PM To: TRAN, Loi X. Cc: rxtx at qbang.org Subject: Re: [Rxtx] Prolific USB - RXTX data mangled On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From Martin.Oberhuber at windriver.com Wed Apr 23 18:54:26 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 02:54:26 +0200 Subject: [Rxtx] RXTX port locking on Linux status? Message-ID: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Dear RXTX community, I'm wondering what the status is with RXTX locking serial ports on Linux? My understanding is that the mechanism used in 2.1-7r2 (lockfiles) is not really state of the art, and has lots of problems (e.g. missing permissions). There was an idea to migrate towards a Kernel syscall based solution for port locking. What's the status here? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/9878db9f/attachment-0036.html From tjarvi at qbang.org Wed Apr 23 20:32:24 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Apr 2008 20:32:24 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > Dear RXTX community, > > I'm wondering what the status is with RXTX locking > serial ports on Linux? > > My understanding is that the mechanism used in > 2.1-7r2 (lockfiles) is not really state of the art, and > has lots of problems (e.g. missing permissions). > > There was an idea to migrate towards a Kernel > syscall based solution for port locking. > > What's the status here? > Hi Martin, I'm in favor of deprecating the current FHS locking mechanism in favor of an IOCTL when available. I think it will be available on all the platforms but do not know for sure. The status is unchanged. I've had very few free cycles for such things. Feel free to take a stab at it if you have some time. I believe the IOCTL is used in the Mac OS X code already. I don't see any real backwards compatability issues and the IOCTL should just work. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Apr 24 06:14:06 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 14:14:06 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Thanks Trent. Problem is only that I'm really not at all Familiar with the C part of RXTX. If there Were anything I could do in Java for this, It would be easier for me.... ... Are there any C experts here on the list Who'd like to look at ioctl port locking For linux? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Donnerstag, 24. April 2008 04:32 > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > I'm wondering what the status is with RXTX locking > > serial ports on Linux? > > > > My understanding is that the mechanism used in > > 2.1-7r2 (lockfiles) is not really state of the art, and > > has lots of problems (e.g. missing permissions). > > > > There was an idea to migrate towards a Kernel > > syscall based solution for port locking. > > > > What's the status here? > > > > Hi Martin, > > I'm in favor of deprecating the current FHS locking mechanism > in favor of > an IOCTL when available. I think it will be available on all the > platforms but do not know for sure. > > The status is unchanged. I've had very few free cycles for > such things. > Feel free to take a stab at it if you have some time. I > believe the IOCTL > is used in the Mac OS X code already. > > I don't see any real backwards compatability issues and the > IOCTL should > just work. > > -- > Trent Jarvi > tjarvi at qbang.org > From sspies at sloc.de Thu Apr 24 07:15:36 2008 From: sspies at sloc.de (Sebastian Spies) Date: Thu, 24 Apr 2008 15:15:36 +0200 (CEST) Subject: [Rxtx] rxtx on gumstix: Interrupted system call In-Reply-To: <47FB7B20.7080504@sloc.de> References: <47FB7B20.7080504@sloc.de> Message-ID: <55445.130.83.139.205.1209042936.squirrel@ssl.sloc.de> Dear list, while porting rxtx to the gumstix, I found out, that select used in readArray in SerialImp.c might not work as expected. Maybe, because of missing TIOCSERGETLSR-support? select is often interrupted, so i wrote the following quick'n'dirty hack to make it work on gumstix: diff -Nur rxtx-2.1-7r2/src/SerialImp.c rxtx-2.1-7r2/src/SerialImp.c --- rxtx-2.1-7r2/src/SerialImp.c 2006-01-29 23:19:04.000000000 +0100 +++ rxtx-2.1-7r2-patched/src/SerialImp.c 2008-04-24 14:30:17.000000000 +0200 @@ -3380,7 +3381,7 @@ JNIEXPORT jint JNICALL RXTXPort(readArray)( JNIEnv *env, jobject jobj, jbyteArray jbarray, jint offset, jint length ) { - int bytes; + int bytes = 0; jbyte *body; /* char msg[80]; */ int fd = get_java_var( env, jobj, "fd", "I" ); @@ -3397,9 +3398,18 @@ "readArray", "Invalid length" ); return -1; } - body = (*env)->GetByteArrayElements( env, jbarray, 0 ); - bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ - (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + while(1 > bytes) + { + body = (*env)->GetByteArrayElements( env, jbarray, 0 ); + bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ + (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + // quick'n'dirty - SSP + report (" trying again... \n"); + errno = 0; + } + if( bytes < 0 ) { report( "RXTXPort:readArray bytes < 0" ); LEAVE( "RXTXPort:readArray" ); > Hey, > > I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use > RXTXPort$SerialInputStream.read(), then I get the following Exception. I > did not yet figure out which system call is interrupted as strace > produces loads of output. > > Any help would be very appreciated. Thanks in advance. > Sebastian > > > [java] java.io.IOException: Interrupted system call in readArray > [java] at gnu.io.RXTXPort.readArray(Native Method) > [java] at > gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) > [java] at > java.io.FilterInputStream.read(FilterInputStream.java:189) > [java] at > java.io.BufferedInputStream.refill(BufferedInputStream.java:371) > [java] at > java.io.BufferedInputStream.read(BufferedInputStream.java:229) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) > [java] at > com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) > > -- > Sebastian Spies > > mail: sspies at sloc.de > > > > From fire_baptized at hotmail.com Thu Apr 24 18:27:48 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Thu, 24 Apr 2008 20:27:48 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hello I am having a problem with the serial device connecting (software wise) to the serial port. However I have a test program and it seems to work just fine in that environment - and it doesnt use GUI. The error I am getting is : PortNotFoundException Now the way I have it setup in the GUI environment is that once the user pushes a JButton the program connects using this class: protected void establishConnection() { try { portId = CommPortIdentifier.getPortIdentifier("COM3"); System.out.println("Establishing connction....."); messages[0] = "\nEstablishing connction.....\n"; } catch ( NoSuchPortException noport) { System.out.println("Port not found: "+ noport); messages[0] = "Port not found: "+ noport+"\n"; } try { serialPort = (SerialPort) portId.open("serial", 50); System.out.println("Port has been found."); messages[1] = "Port has been found.\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[1] = "" +usedport; } try { serialPort = (SerialPort) portId.open("serial", 50); messages[2] = "Connecting to COM3 on port 50....\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; } try { serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); System.out.println("Esablishing the transfer rate settings for COM3."); messages[3] = "Esablishing the transfer rate settings for COM3.\n"; } catch (UnsupportedCommOperationException nosupcom) { System.out.println(nosupcom); System.out.println("The tranfer rate could not be esblished on COM3."); messages[3] = "The tranfer rate could not be esblished on COM3.\n"; } System.out.println(serialPort.getFlowControlMode()); messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; //sendDataOut(buffer[3],buffer[4]); } I need all the data in this method (and all the string values in this method) to be printed out on a JTextArea. I wont do me any good if not all the text is printed on a JTextArea in another class. So I have the text printing the JTextArea correctly, but everytime the JButton is activated - it gives me that error message. I did add a disconnect button that is supposed to call the serialPort.close(). _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/273fd4ec/attachment-0035.html From tjarvi at qbang.org Thu Apr 24 21:54:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Apr 2008 21:54:10 -0600 (MDT) Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > Hello I am having a problem with the serial device connecting (software > wise) to the serial port. However I have a test program and it seems to > work just fine in that environment - and it doesnt use GUI. The error I > am getting is : PortNotFoundException Now the way I have it setup in the > GUI environment is that once the user pushes a JButton the program > connects using this class: > > protected void establishConnection() { > try { > portId = CommPortIdentifier.getPortIdentifier("COM3"); > System.out.println("Establishing connction....."); > messages[0] = "\nEstablishing connction.....\n"; > } > catch ( NoSuchPortException noport) { > System.out.println("Port not found: "+ noport); > messages[0] = "Port not found: "+ noport+"\n"; > } > try { > serialPort = (SerialPort) portId.open("serial", 50); > System.out.println("Port has been found."); > messages[1] = "Port has been found.\n"; > } > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[1] = "" +usedport; > } ================================================================= > try { > serialPort = (SerialPort) portId.open("serial", 50); > messages[2] = "Connecting to COM3 on port 50....\n"; > } ================================================================== > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > } > try { > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > System.out.println("Esablishing the transfer rate settings for COM3."); > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > } > catch (UnsupportedCommOperationException nosupcom) { > System.out.println(nosupcom); > System.out.println("The tranfer rate could not be esblished on COM3."); > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > } > System.out.println(serialPort.getFlowControlMode()); > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > //sendDataOut(buffer[3],buffer[4]); > } > > I need all the data in this method (and all the string values in this > method) to be printed out on a JTextArea. I wont do me any good if not > all the text is printed on a JTextArea in another class. So I have the > text printing the JTextArea correctly, but everytime the JButton is > activated - it gives me that error message. I did add a disconnect > button that is supposed to call the serialPort.close(). > The open code used twice is going to throw an exception. It may be that you catch the exception above this code and print a confusing message? A common mistake is people will accidently run two copies of their program. The first instance of the program will open the port and prevent enumeration (finding the port) in the second instance of the program. As an example, you may be running your text based application which is preventing the GUI from seeing the port. Enumeration is done by trying to open the port. If the port is open, Enumeration fails. -- Trent Jarvi tjarvi at qbang.org From fire_baptized at hotmail.com Thu Apr 24 22:32:05 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 00:32:05 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Wow - thanks dude what a dumb thing for me to not catch..... now here is the current problem - right now I am trying to output data again one is with the test program - and it seems that serialPort.setRTS(true); is throwing an exceptions there - now if I show this code please bare in mind that I am only testing - the code is kinda sloppy in my mind - but if I can figure out why calling this function is throwing an exception then maybe I can figure out why my GUI application is getting the same null pointer exceptions when try to send out the data stream. FYI Trent this email is not directed towards you - anyone can jump in on this public static void main(String args[]) { byte[] b = new byte[64]; int keyinput = 0 ; byte x = 0; byte y = 0; PortTesting1 testports = new PortTesting1(); try { joyskoro = Joystick.createInstance(); } catch (IOException ioexc) { System.out.println("There is an input/output problem: " + ioexc); } while (true) { joyskoro.poll(); b[0] = ((byte) -(10 * joyskoro.getY())); b[1] = ((byte) (10 * joyskoro.getX())); System.out.println("The 3rd byte is: " +b[0]); System.out.println("The 4rd byte is: " +b[1]); serialPort.setRTS(true); // HERE IS WHERE THE PROBLEM IS !!!!!!! ON THIS LINE but if I dont have it active in my program the Bluetooth device (that is System.out.println("Ready to send :-) !"); //connected to the serial port does not send out data!!!!! if (joyskoro.isButtonDown(joyskoro.BUTTON10)) { System.out.println("Connection terminated."); serialPort.close(); break; } if (joyskoro.isButtonDown(joyskoro.BUTTON2)) { boolean flag = true; //reading from key input from the keyboard System.out.println("Please input a command: "); while (flag) { try { keyinput = System.in.read(); } catch (IOException ioexc) {/*there is no need to put * anything here */ } if((char)keyinput=='w') { pushIt((byte)85); } if((char)keyinput=='s') { pushIt((byte)84); } if((char)keyinput=='a') { pushIt((byte)83); } if((char)keyinput=='d') { pushIt((byte)82); } if((char)keyinput=='q') { pushIt((byte)89); } if((char)keyinput=='\t') { //this stop reading input from the keyboard flag = false; } } and help anyways here is the block of code that throwing an exception for the test program: > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/5c8f7d68/attachment-0035.html From fire_baptized at hotmail.com Fri Apr 25 07:59:53 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 09:59:53 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Are there any examples of how to push out data? As in using input and output streams - if I can compare code maybe I can see where this is causing a problem. I have a byte array that I am pushing out data. I keep getting null pointer exceptions every where I turn. > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/22228ab6/attachment-0034.html From ajmas at sympatico.ca Sat Apr 26 07:37:09 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 26 Apr 2008 09:37:09 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hi, On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote: > > Are there any examples of how to push out data? As in using input > and output streams - if I can compare code maybe I can see where > this is causing a problem. I have a byte array that I am pushing > out data. I keep getting null pointer exceptions every where I turn. > There are some examples here that might be of help: http://rxtx.qbang.org/wiki/index.php/Examples Andre From fire_baptized at hotmail.com Sat Apr 26 20:13:54 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Sat, 26 Apr 2008 22:13:54 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: looked at those....yep didnt help - I need to push out data with GUI and not get a null pointer exception everytime I try. > CC: rxtx at qbang.org> From: ajmas at sympatico.ca> To: fire_baptized at hotmail.com> Subject: Re: [Rxtx] Serial Problems with Gui.....> Date: Sat, 26 Apr 2008 09:37:09 -0400> > Hi,> > > On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote:> >> > Are there any examples of how to push out data? As in using input > > and output streams - if I can compare code maybe I can see where > > this is causing a problem. I have a byte array that I am pushing > > out data. I keep getting null pointer exceptions every where I turn.> >> > There are some examples here that might be of help:> > http://rxtx.qbang.org/wiki/index.php/Examples> > Andre _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080426/09f95b41/attachment-0033.html From michael.erskine at ketech.com Mon Apr 28 02:47:22 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 28 Apr 2008 09:47:22 +0100 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D426EF3CBBC5@no-sv-03.ketech.local> Jesrael D. Summerhill wrote: > looked at those....yep didnt help - I need to push out data with GUI and > not get a null pointer exception everytime I try. So it seems pretty obvious that your code needs to check for nulls wherever one may occur and report what's happening. Alternatively, catch the npe and display the stack trace. Then you can fix your code so it doesn't try to work with something that ain't there. Regards, Michael Erskine. From scldad at sdc.com.au Mon Apr 28 03:58:34 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Mon, 28 Apr 2008 19:28:34 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Message-ID: <200804281928.34454.scldad@sdc.com.au> Has anybody done any design work on this? The first thing that springs to mind is that we still need to check for lock files because other apps tend to use that approach even if we go to ioctl. Cheers, Stephen Davies On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > Thanks Trent. > > Problem is only that I'm really not at all > Familiar with the C part of RXTX. If there > Were anything I could do in Java for this, > It would be easier for me.... > > ... Are there any C experts here on the list > Who'd like to look at ioctl port locking > For linux? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > -----Original Message----- > > From: Trent Jarvi [mailto:tjarvi at qbang.org] > > Sent: Donnerstag, 24. April 2008 04:32 > > To: Oberhuber, Martin > > Cc: rxtx at qbang.org > > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > > > I'm wondering what the status is with RXTX locking > > > serial ports on Linux? > > > > > > My understanding is that the mechanism used in > > > 2.1-7r2 (lockfiles) is not really state of the art, and > > > has lots of problems (e.g. missing permissions). > > > > > > There was an idea to migrate towards a Kernel > > > syscall based solution for port locking. > > > > > > What's the status here? > > > > Hi Martin, > > > > I'm in favor of deprecating the current FHS locking mechanism > > in favor of > > an IOCTL when available. I think it will be available on all the > > platforms but do not know for sure. > > > > The status is unchanged. I've had very few free cycles for > > such things. > > Feel free to take a stab at it if you have some time. I > > believe the IOCTL > > is used in the Mac OS X code already. > > > > I don't see any real backwards compatability issues and the > > IOCTL should > > just work. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Mon Apr 28 04:21:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 28 Apr 2008 04:21:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804281928.34454.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: I don't think there would need to be any architectural changes. A couple ifdefs and minor changes in the current code should be enough. Proposal: FHS/UUCP locks: continue to respect them, try to create them but do not error if the IOCTL is supported. (But does the IOCTL being defined mean it will work?) Enumeration: Do not assert the IOCTL while opening. Serial.open: assert the IOCTL after open. Continue to use locks as described above after asserting the IOCTL. If the IOCTL is defined but not working, handle it here. Failure cases include the IOCTL is not supported and the port is already locked. On Mon, 28 Apr 2008, Stephen Davies wrote: > Has anybody done any design work on this? > The first thing that springs to mind is that we still need to check for lock > files because other apps tend to use that approach even if we go to ioctl. > > Cheers, > Stephen Davies > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: >> Thanks Trent. >> >> Problem is only that I'm really not at all >> Familiar with the C part of RXTX. If there >> Were anything I could do in Java for this, >> It would be easier for me.... >> >> ... Are there any C experts here on the list >> Who'd like to look at ioctl port locking >> For linux? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >>> -----Original Message----- >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] >>> Sent: Donnerstag, 24. April 2008 04:32 >>> To: Oberhuber, Martin >>> Cc: rxtx at qbang.org >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? >>> >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: >>>> Dear RXTX community, >>>> >>>> I'm wondering what the status is with RXTX locking >>>> serial ports on Linux? >>>> >>>> My understanding is that the mechanism used in >>>> 2.1-7r2 (lockfiles) is not really state of the art, and >>>> has lots of problems (e.g. missing permissions). >>>> >>>> There was an idea to migrate towards a Kernel >>>> syscall based solution for port locking. >>>> >>>> What's the status here? >>> >>> Hi Martin, >>> >>> I'm in favor of deprecating the current FHS locking mechanism >>> in favor of >>> an IOCTL when available. I think it will be available on all the >>> platforms but do not know for sure. >>> >>> The status is unchanged. I've had very few free cycles for >>> such things. >>> Feel free to take a stab at it if you have some time. I >>> believe the IOCTL >>> is used in the Mac OS X code already. >>> >>> I don't see any real backwards compatability issues and the >>> IOCTL should >>> just work. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Tue Apr 29 12:04:04 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Apr 2008 20:04:04 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Hi all, The biggest problem that I have seen with lockfiles on Linux At least is, that it seems there is no standard with respect To the folder in which they should be created. Also, many Distributions seem to set up file system permissions in such A way that writing to the lockfile folder is not allowed for The normal user -- that's why we stopped using lockfiles In our commercial product. If we are to still respect lockfiles, we first need to Understand where we are expected to look for them. Does Anybody have any insight what variants of lockfile folder Schema exist out there in the wild? Some apps like minicom Seem to even allow users to manually specify a lockfile Folder of their choice. Because of the difficulty finding the right lockfile folder, And because of the inherent risk of thinking that something Might be locked while it actually isn't, I'd suggest that RXTX should have a "soft-off" feature that allows disabling ALL Lockfile checks at runtime without recompiling the native Sharedlibs. Trent - I like your strategy outline, but I think that it Needs to be configurable by the client such that users and/or Customer Support can disable lockfiles / disable ioctl in Case they detect that they are runing on an OS / Kernal that Does not support one or the other. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Montag, 28. April 2008 12:22 > To: Stephen Davies > Cc: rxtx at qbang.org; Oberhuber, Martin; Trent Jarvi > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > I don't think there would need to be any architectural > changes. A couple > ifdefs and minor changes in the current code should be enough. > > Proposal: > > FHS/UUCP locks: > continue to respect them, try to create them but do not error if > the IOCTL is supported. (But does the IOCTL being defined mean > it will work?) > Enumeration: > Do not assert the IOCTL while opening. > Serial.open: > assert the IOCTL after open. Continue to use locks as described > above after asserting the IOCTL. If the IOCTL is defined but > not working, handle it here. Failure cases include the IOCTL > is not supported and the port is already locked. > > On Mon, 28 Apr 2008, Stephen Davies wrote: > > > Has anybody done any design work on this? > > The first thing that springs to mind is that we still need > to check for lock > > files because other apps tend to use that approach even if > we go to ioctl. > > > > Cheers, > > Stephen Davies > > > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > >> Thanks Trent. > >> > >> Problem is only that I'm really not at all > >> Familiar with the C part of RXTX. If there > >> Were anything I could do in Java for this, > >> It would be easier for me.... > >> > >> ... Are there any C experts here on the list > >> Who'd like to look at ioctl port locking > >> For linux? > >> > >> Thanks, > >> -- > >> Martin Oberhuber, Senior Member of Technical Staff, Wind River > >> Target Management Project Lead, DSDP PMC Member > >> http://www.eclipse.org/dsdp/tm > >> > >>> -----Original Message----- > >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] > >>> Sent: Donnerstag, 24. April 2008 04:32 > >>> To: Oberhuber, Martin > >>> Cc: rxtx at qbang.org > >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? > >>> > >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > >>>> Dear RXTX community, > >>>> > >>>> I'm wondering what the status is with RXTX locking > >>>> serial ports on Linux? > >>>> > >>>> My understanding is that the mechanism used in > >>>> 2.1-7r2 (lockfiles) is not really state of the art, and > >>>> has lots of problems (e.g. missing permissions). > >>>> > >>>> There was an idea to migrate towards a Kernel > >>>> syscall based solution for port locking. > >>>> > >>>> What's the status here? > >>> > >>> Hi Martin, > >>> > >>> I'm in favor of deprecating the current FHS locking mechanism > >>> in favor of > >>> an IOCTL when available. I think it will be available on all the > >>> platforms but do not know for sure. > >>> > >>> The status is unchanged. I've had very few free cycles for > >>> such things. > >>> Feel free to take a stab at it if you have some time. I > >>> believe the IOCTL > >>> is used in the Mac OS X code already. > >>> > >>> I don't see any real backwards compatability issues and the > >>> IOCTL should > >>> just work. > >>> > >>> -- > >>> Trent Jarvi > >>> tjarvi at qbang.org > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > From Steffen.DETTMER at ingenico.com Tue Apr 29 13:34:44 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 29 Apr 2008 21:34:44 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Message-ID: <20080429193444.GU2928@elberon.bln.de.ingenico.com> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > The biggest problem that I have seen with lockfiles on Linux > At least is, that it seems there is no standard with respect > To the folder in which they should be created. Also, many > Distributions seem to set up file system permissions in such > A way that writing to the lockfile folder is not allowed for > The normal user -- that's why we stopped using lockfiles > In our commercial product. It seems it depends on the expectations. I consider it as a feature that by default a linux user cannot access serial ports. Maybe root connected a modem (can produce phone bills) or even some serial card reader, maybe with the web servers key pair. I would expect that by default a user cannot open the serial port because of insufficient permissions on the device file. I would expect this on other unices as well (but I don't know it). For windows I think it should be similar but not impacting so much in practice, because often windows users work with big permissions on a somewhat high priviledge level or even Administrator. > If we are to still respect lockfiles, we first need to > Understand where we are expected to look for them. Does > Anybody have any insight what variants of lockfile folder > Schema exist out there in the wild? Some apps like minicom > Seem to even allow users to manually specify a lockfile > Folder of their choice. At least my (ancient) minicom does not allow the user to change this option, it is displayed but read-only, but root is allowed to change it. > Because of the difficulty finding the right lockfile folder, > And because of the inherent risk of thinking that something > Might be locked while it actually isn't, I'd suggest that > RXTX should have a "soft-off" feature that allows disabling > ALL Lockfile checks at runtime without recompiling the native > Sharedlibs. sounds very reasonable, yes... and as admin I would not wish that users could skip such locking because they do things wrong by default ;) (in the end I guess that is related to the dilemma, that hotplug/user-owned-periphery and multi-user systems simply conflict) > Trent - I like your strategy outline, but I think that it > Needs to be configurable by the client such that users and/or > Customer Support can disable lockfiles / disable ioctl in > Case they detect that they are runing on an OS / Kernal that > Does not support one or the other. Yes, this would be good I guess... Applications could offer configuration options to control that, maybe similarily as minicom. BTW, man minicom tells: *B - Lock file location On most systems This should be /usr/spool/uucp. Linux systems use /var/lock. If this directory does not exist, minicom will not attempt to use lockfiles. The statement `Linux systems use /var/lock' is interesting, does anyone know the source of this convention? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Tue Apr 29 16:11:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Apr 2008 16:11:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? These details are outlined in the Filesystem Hierarchy Standard (FHS). http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLOCKLOCKFILES -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Tue Apr 29 18:58:09 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Wed, 30 Apr 2008 10:28:09 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: <200804301028.09307.scldad@sdc.com.au> I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is the same. Any ideas as to how to handle this? Stephen On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: > * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > > The biggest problem that I have seen with lockfiles on Linux > > At least is, that it seems there is no standard with respect > > To the folder in which they should be created. Also, many > > Distributions seem to set up file system permissions in such > > A way that writing to the lockfile folder is not allowed for > > The normal user -- that's why we stopped using lockfiles > > In our commercial product. > > It seems it depends on the expectations. I consider it as a > feature that by default a linux user cannot access serial ports. > Maybe root connected a modem (can produce phone bills) or even > some serial card reader, maybe with the web servers key pair. > > I would expect that by default a user cannot open the serial port > because of insufficient permissions on the device file. I would > expect this on other unices as well (but I don't know it). > > For windows I think it should be similar but not impacting so > much in practice, because often windows users work with big > permissions on a somewhat high priviledge level or even > Administrator. > > > If we are to still respect lockfiles, we first need to > > Understand where we are expected to look for them. Does > > Anybody have any insight what variants of lockfile folder > > Schema exist out there in the wild? Some apps like minicom > > Seem to even allow users to manually specify a lockfile > > Folder of their choice. > > At least my (ancient) minicom does not allow the user to change > this option, it is displayed but read-only, but root is allowed > to change it. > > > Because of the difficulty finding the right lockfile folder, > > And because of the inherent risk of thinking that something > > Might be locked while it actually isn't, I'd suggest that > > RXTX should have a "soft-off" feature that allows disabling > > ALL Lockfile checks at runtime without recompiling the native > > Sharedlibs. > > sounds very reasonable, yes... > and as admin I would not wish that users could skip such > locking because they do things wrong by default ;) > > (in the end I guess that is related to the dilemma, that > hotplug/user-owned-periphery and multi-user systems simply > conflict) > > > Trent - I like your strategy outline, but I think that it > > Needs to be configurable by the client such that users and/or > > Customer Support can disable lockfiles / disable ioctl in > > Case they detect that they are runing on an OS / Kernal that > > Does not support one or the other. > > Yes, this would be good I guess... Applications could offer > configuration options to control that, maybe similarily as > minicom. > > BTW, man minicom tells: > > *B - Lock file location > On most systems This should be /usr/spool/uucp. > Linux systems use /var/lock. If this directory > does not exist, minicom will not attempt to use > lockfiles. > > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure > and expedient electronic transaction acceptance. Ingenico products leverage > proven technology, established standards and unparalleled ergonomics to > provide optimal reliability, versatility and usability. This comprehensive > range of products is complemented by a global array of services and > partnerships, enabling businesses in a number of vertical sectors to accept > transactions anywhere their business takes them. www.ingenico.com This > message may contain confidential and/or privileged information. If you are > not the addressee or authorized to receive this for the addressee, you must > not use, copy, disclose or take any action based on this message or any > information herein. If you have received this message in error, please > advise the sender immediately by reply e-mail and delete this message. > Thank you for your cooperation. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Wed Apr 30 19:30:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 30 Apr 2008 19:30:51 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804301028.09307.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> <200804301028.09307.scldad@sdc.com.au> Message-ID: Hi Stephen, I suspect ioctl/TIOCEXCL open/O_EXCL would do the job. Mac uses TIOCEXCL and it is POSIX. We use O_EXCL for lockfiles on Linux already. On Wed, 30 Apr 2008, Stephen Davies wrote: > I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is > the same. > > Any ideas as to how to handle this? > > Stephen > > > On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: >> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: >>> The biggest problem that I have seen with lockfiles on Linux >>> At least is, that it seems there is no standard with respect >>> To the folder in which they should be created. Also, many >>> Distributions seem to set up file system permissions in such >>> A way that writing to the lockfile folder is not allowed for >>> The normal user -- that's why we stopped using lockfiles >>> In our commercial product. >> >> It seems it depends on the expectations. I consider it as a >> feature that by default a linux user cannot access serial ports. >> Maybe root connected a modem (can produce phone bills) or even >> some serial card reader, maybe with the web servers key pair. >> >> I would expect that by default a user cannot open the serial port >> because of insufficient permissions on the device file. I would >> expect this on other unices as well (but I don't know it). >> >> For windows I think it should be similar but not impacting so >> much in practice, because often windows users work with big >> permissions on a somewhat high priviledge level or even >> Administrator. >> >>> If we are to still respect lockfiles, we first need to >>> Understand where we are expected to look for them. Does >>> Anybody have any insight what variants of lockfile folder >>> Schema exist out there in the wild? Some apps like minicom >>> Seem to even allow users to manually specify a lockfile >>> Folder of their choice. >> >> At least my (ancient) minicom does not allow the user to change >> this option, it is displayed but read-only, but root is allowed >> to change it. >> >>> Because of the difficulty finding the right lockfile folder, >>> And because of the inherent risk of thinking that something >>> Might be locked while it actually isn't, I'd suggest that >>> RXTX should have a "soft-off" feature that allows disabling >>> ALL Lockfile checks at runtime without recompiling the native >>> Sharedlibs. >> >> sounds very reasonable, yes... >> and as admin I would not wish that users could skip such >> locking because they do things wrong by default ;) >> >> (in the end I guess that is related to the dilemma, that >> hotplug/user-owned-periphery and multi-user systems simply >> conflict) >> >>> Trent - I like your strategy outline, but I think that it >>> Needs to be configurable by the client such that users and/or >>> Customer Support can disable lockfiles / disable ioctl in >>> Case they detect that they are runing on an OS / Kernal that >>> Does not support one or the other. >> >> Yes, this would be good I guess... Applications could offer >> configuration options to control that, maybe similarily as >> minicom. >> >> BTW, man minicom tells: >> >> *B - Lock file location >> On most systems This should be /usr/spool/uucp. >> Linux systems use /var/lock. If this directory >> does not exist, minicom will not attempt to use >> lockfiles. >> >> The statement `Linux systems use /var/lock' is interesting, does >> anyone know the source of this convention? >> >> oki, >> >> Steffen >> >> About Ingenico Throughout the world businesses rely on Ingenico for secure >> and expedient electronic transaction acceptance. Ingenico products leverage >> proven technology, established standards and unparalleled ergonomics to >> provide optimal reliability, versatility and usability. This comprehensive >> range of products is complemented by a global array of services and >> partnerships, enabling businesses in a number of vertical sectors to accept >> transactions anywhere their business takes them. www.ingenico.com This >> message may contain confidential and/or privileged information. If you are >> not the addressee or authorized to receive this for the addressee, you must >> not use, copy, disclose or take any action based on this message or any >> information herein. If you have received this message in error, please >> advise the sender immediately by reply e-mail and delete this message. >> Thank you for your cooperation. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0059.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0057.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0044.html From pboulton at pulsetracer.com Fri Apr 18 14:30:13 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Fri, 18 Apr 2008 13:30:13 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site Message-ID: <480904D5.1060307@pulsetracer.com> Hello, gentle serial porters. I have downloaded the zipped up binaries for use on Windows without Sun's CommAPI, but don't seem able to extract anything from the download. Go to main page, http://www.rxtx.org/ Click on Downloads I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) And I save it to disk. If I try and extract the files with WinZip, Winzip thinks the archive is corrupt. If I try using Windows Explorer, I am able to extract it into a single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than the original .zip. Any help would be much appreciated. Sincerely, Philip Boulton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080418/97d89793/attachment-0042.html From tjarvi at qbang.org Fri Apr 18 19:07:00 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 18 Apr 2008 19:07:00 -0600 (MDT) Subject: [Rxtx] Difficulty opening zip file at rxtx site In-Reply-To: <480904D5.1060307@pulsetracer.com> References: <480904D5.1060307@pulsetracer.com> Message-ID: On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org From pboulton at pulsetracer.com Sat Apr 19 12:46:26 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Sat, 19 Apr 2008 11:46:26 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site References: <480904D5.1060307@pulsetracer.com> Message-ID: <53DB7576450695419E09299104043761A78533@ZTGSERVER.ztg.local> I have been able to get my hands on the binaries, by going to the ftp directory /pub/rxtx at ftp.qbang.org,, and ftping the file rxtx-2.1-7-bins-r2.zip . This opens happily with Winzip, and extracts as the set of files that you describe below. I only experience the ill-formed archive problem by clicking the link on the rxtx.org Downloads page (http://rxtx.qbang.org/pub/rxtx/ rxtx-2.1-7-bins-r2.zip ). Not sure what to make of that. Philip Boulton ________________________________ From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Fri 4/18/2008 6:07 PM To: Philip Boulton Cc: rxtx at qbang.org Subject: Re: [Rxtx] Difficulty opening zip file at rxtx site On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080419/147923bb/attachment-0041.html From jlar310 at gmail.com Sat Apr 19 19:11:55 2008 From: jlar310 at gmail.com (Jeff Larsen) Date: Sat, 19 Apr 2008 20:11:55 -0500 Subject: [Rxtx] Moxa serial over Ethernet driver Message-ID: Hi all, I've been using javax.comm for years to communicate with a legacy radio data system. We want to migrate the java side of the system to a VMware Server virtual machine. We've had great success using Moxa DE-303 and 5610 serial over Ethernet appliances and virtual machines for running hylafax. The OS (Linux in this case) uses a kernel driver to communicate with the Moxa via a virtual serial port such as /dev/ttyr00. I want to do the same thing with javax.comm or gnu.io to connect to a virtual serial port. However I'm hitting road blocks everywhere. javax.comm for Linux sees the virtual port, but there are transmission errors. Tried Solaris too, but the Solaris Moxa drivers don't play nice with javax.comm because the driver uses /dev/pts/n instead of /dev/term/x. Next I tried RXTX on Linux, but I'm getting NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX on Solaris. Has anyone used RXTX with serial over Ethernet devices? Any hints on how to make it work? I know that I'm not completely off track because javax.comm does work with Moxa on a Windows platform, but that's just not an option for production deployment. -- Jeff From tjarvi at qbang.org Sat Apr 19 21:08:41 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 19 Apr 2008 21:08:41 -0600 (MDT) Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: yOn Sat, 19 Apr 2008, Jeff Larsen wrote: > Hi all, > > I've been using javax.comm for years to communicate with a legacy > radio data system. We want to migrate the java side of the system to a > VMware Server virtual machine. We've had great success using Moxa > DE-303 and 5610 serial over Ethernet appliances and virtual machines > for running hylafax. The OS (Linux in this case) uses a kernel driver > to communicate with the Moxa via a virtual serial port such as > /dev/ttyr00. > > I want to do the same thing with javax.comm or gnu.io to connect to a > virtual serial port. However I'm hitting road blocks everywhere. > javax.comm for Linux sees the virtual port, but there are transmission > errors. Tried Solaris too, but the Solaris Moxa drivers don't play > nice with javax.comm because the driver uses /dev/pts/n instead of > /dev/term/x. Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris. > > Has anyone used RXTX with serial over Ethernet devices? Any hints on > how to make it work? > > I know that I'm not completely off track because javax.comm does work > with Moxa on a Windows platform, but that's just not an option for > production deployment. > > Moxa should work under linux. There may be minor issues depending upon how complete the kernel driver is but I think it will work. One of the minor issues is /dev/ttyr00 is not enumerated. There are several work arounds documented with the source code and on the wiki. The easiest solution for testing purposes is to make a symbolic link from /dev/ttyr00 to a port that is enumerated such as /dev/ttyS129. You can later alter the rxtx source or use properties to change the enumerated ports. -- Trent Jarvi tjarvi at qbang.org From d.tonhofer at m-plify.com Sun Apr 20 03:33:30 2008 From: d.tonhofer at m-plify.com (David Tonhofer (M-PLIFY S.A.)) Date: Sun, 20 Apr 2008 11:33:30 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: <480B0DEA.5010908@m-plify.com> Jeff Larsen wrote: > Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris It might be that the Java side of RXTX does not recognize that portname. Trying modifying src/RXTXCommDriver.java as described in this case: http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card From ajmas at sympatico.ca Sun Apr 20 16:37:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Apr 2008 18:37:59 -0400 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <480B0DEA.5010908@m-plify.com> References: <480B0DEA.5010908@m-plify.com> Message-ID: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > Jeff Larsen wrote: >> Next I tried RXTX on Linux, but I'm getting >> NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX >> on Solaris > It might be that the Java side of RXTX does not recognize that > portname. > Trying modifying src/RXTXCommDriver.java as described in this case: > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card I wonder whether it would be worth allowing custom port prefixes as a system parameter? For example: gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" Andre From Martin.Oberhuber at windriver.com Tue Apr 22 12:34:36 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 22 Apr 2008 20:34:36 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> References: <480B0DEA.5010908@m-plify.com> <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE6485848056CD6CE@ism-mail03.corp.ad.wrs.com> Sounds like a great idea... I'm wondering how the "variable part" after the Prefixes could be specified though? What about allowing Regular Expression character Classes in the existing System Property for specifying ports: System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyS[0-9],ttyS[ABC],ttyUSB[0-9a-z]"); The set of allowed patterns would of course need to Be restricted compared to REGEX, because it must be A syntax that supports iterating over it. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Montag, 21. April 2008 00:38 > To: rxtx at qbang.org and Users > Subject: Re: [Rxtx] Moxa serial over Ethernet driver > > > On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > > Jeff Larsen wrote: > >> Next I tried RXTX on Linux, but I'm getting > >> NoSuchPortException connecting to /dev/ttyr00. I have yet > to try RXTX > >> on Solaris > > It might be that the Java side of RXTX does not recognize that > > portname. > > Trying modifying src/RXTXCommDriver.java as described in this case: > > > > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_ > SST-4P.2FLP_multiport_card > > I wonder whether it would be worth allowing custom port > prefixes as a > system parameter? For > example: > > gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Loi.TRAN at weatherford.com Tue Apr 22 13:10:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Tue, 22 Apr 2008 14:10:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled Message-ID: Hi, I'm currently using the Java RXTX API to interface to a serial port. The serial port is connected to a bridge board that communicates with our communications system running at 1.875 Mbps which is linked to an embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no flow control). I send a command to the embedded board through the serial-bridge board which then is relayed to the embedded board. The command sent asks the embedded board to dump a binary image. Here's where I'm hitting some problems. I've successfully done this is an integrated serial port from the laptop. The binary file that comes back is consistent on every attempt. When I use the application I've written to do the same thing with a USB-to-serial adapter, the image I get back is not the same as the image I receive through the USB-to-serial adapter is not consistent at all. A final thing is that when I use a terminal program to dump the binary image with the USB-serial adapter, the image is correct. Every time! What is the terminal program doing that's not being done in my application? My application is quite simple. Has anyone observed this behavior before? If you have, I'd like to know how you've gotten around this problem. Thanks, LT =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From tjarvi at qbang.org Tue Apr 22 21:11:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 22 Apr 2008 21:11:10 -0600 (MDT) Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org From Loi.TRAN at weatherford.com Wed Apr 23 08:35:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Wed, 23 Apr 2008 09:35:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: Thanks for all the responses. I finally tried something that worked consistently. I updated my Prolific driver and repeated my tests. It worked. If you're using the Prolific type USB-serial adapters, do no use the Prolific version 2.0.2.1 driver on Windows. Update it to the latest 2.0.2.8 version. Again, thanks for all the responses. LT -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Tuesday, April 22, 2008 10:11 PM To: TRAN, Loi X. Cc: rxtx at qbang.org Subject: Re: [Rxtx] Prolific USB - RXTX data mangled On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From Martin.Oberhuber at windriver.com Wed Apr 23 18:54:26 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 02:54:26 +0200 Subject: [Rxtx] RXTX port locking on Linux status? Message-ID: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Dear RXTX community, I'm wondering what the status is with RXTX locking serial ports on Linux? My understanding is that the mechanism used in 2.1-7r2 (lockfiles) is not really state of the art, and has lots of problems (e.g. missing permissions). There was an idea to migrate towards a Kernel syscall based solution for port locking. What's the status here? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/9878db9f/attachment-0037.html From tjarvi at qbang.org Wed Apr 23 20:32:24 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Apr 2008 20:32:24 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > Dear RXTX community, > > I'm wondering what the status is with RXTX locking > serial ports on Linux? > > My understanding is that the mechanism used in > 2.1-7r2 (lockfiles) is not really state of the art, and > has lots of problems (e.g. missing permissions). > > There was an idea to migrate towards a Kernel > syscall based solution for port locking. > > What's the status here? > Hi Martin, I'm in favor of deprecating the current FHS locking mechanism in favor of an IOCTL when available. I think it will be available on all the platforms but do not know for sure. The status is unchanged. I've had very few free cycles for such things. Feel free to take a stab at it if you have some time. I believe the IOCTL is used in the Mac OS X code already. I don't see any real backwards compatability issues and the IOCTL should just work. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Apr 24 06:14:06 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 14:14:06 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Thanks Trent. Problem is only that I'm really not at all Familiar with the C part of RXTX. If there Were anything I could do in Java for this, It would be easier for me.... ... Are there any C experts here on the list Who'd like to look at ioctl port locking For linux? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Donnerstag, 24. April 2008 04:32 > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > I'm wondering what the status is with RXTX locking > > serial ports on Linux? > > > > My understanding is that the mechanism used in > > 2.1-7r2 (lockfiles) is not really state of the art, and > > has lots of problems (e.g. missing permissions). > > > > There was an idea to migrate towards a Kernel > > syscall based solution for port locking. > > > > What's the status here? > > > > Hi Martin, > > I'm in favor of deprecating the current FHS locking mechanism > in favor of > an IOCTL when available. I think it will be available on all the > platforms but do not know for sure. > > The status is unchanged. I've had very few free cycles for > such things. > Feel free to take a stab at it if you have some time. I > believe the IOCTL > is used in the Mac OS X code already. > > I don't see any real backwards compatability issues and the > IOCTL should > just work. > > -- > Trent Jarvi > tjarvi at qbang.org > From sspies at sloc.de Thu Apr 24 07:15:36 2008 From: sspies at sloc.de (Sebastian Spies) Date: Thu, 24 Apr 2008 15:15:36 +0200 (CEST) Subject: [Rxtx] rxtx on gumstix: Interrupted system call In-Reply-To: <47FB7B20.7080504@sloc.de> References: <47FB7B20.7080504@sloc.de> Message-ID: <55445.130.83.139.205.1209042936.squirrel@ssl.sloc.de> Dear list, while porting rxtx to the gumstix, I found out, that select used in readArray in SerialImp.c might not work as expected. Maybe, because of missing TIOCSERGETLSR-support? select is often interrupted, so i wrote the following quick'n'dirty hack to make it work on gumstix: diff -Nur rxtx-2.1-7r2/src/SerialImp.c rxtx-2.1-7r2/src/SerialImp.c --- rxtx-2.1-7r2/src/SerialImp.c 2006-01-29 23:19:04.000000000 +0100 +++ rxtx-2.1-7r2-patched/src/SerialImp.c 2008-04-24 14:30:17.000000000 +0200 @@ -3380,7 +3381,7 @@ JNIEXPORT jint JNICALL RXTXPort(readArray)( JNIEnv *env, jobject jobj, jbyteArray jbarray, jint offset, jint length ) { - int bytes; + int bytes = 0; jbyte *body; /* char msg[80]; */ int fd = get_java_var( env, jobj, "fd", "I" ); @@ -3397,9 +3398,18 @@ "readArray", "Invalid length" ); return -1; } - body = (*env)->GetByteArrayElements( env, jbarray, 0 ); - bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ - (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + while(1 > bytes) + { + body = (*env)->GetByteArrayElements( env, jbarray, 0 ); + bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ + (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + // quick'n'dirty - SSP + report (" trying again... \n"); + errno = 0; + } + if( bytes < 0 ) { report( "RXTXPort:readArray bytes < 0" ); LEAVE( "RXTXPort:readArray" ); > Hey, > > I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use > RXTXPort$SerialInputStream.read(), then I get the following Exception. I > did not yet figure out which system call is interrupted as strace > produces loads of output. > > Any help would be very appreciated. Thanks in advance. > Sebastian > > > [java] java.io.IOException: Interrupted system call in readArray > [java] at gnu.io.RXTXPort.readArray(Native Method) > [java] at > gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) > [java] at > java.io.FilterInputStream.read(FilterInputStream.java:189) > [java] at > java.io.BufferedInputStream.refill(BufferedInputStream.java:371) > [java] at > java.io.BufferedInputStream.read(BufferedInputStream.java:229) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) > [java] at > com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) > > -- > Sebastian Spies > > mail: sspies at sloc.de > > > > From fire_baptized at hotmail.com Thu Apr 24 18:27:48 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Thu, 24 Apr 2008 20:27:48 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hello I am having a problem with the serial device connecting (software wise) to the serial port. However I have a test program and it seems to work just fine in that environment - and it doesnt use GUI. The error I am getting is : PortNotFoundException Now the way I have it setup in the GUI environment is that once the user pushes a JButton the program connects using this class: protected void establishConnection() { try { portId = CommPortIdentifier.getPortIdentifier("COM3"); System.out.println("Establishing connction....."); messages[0] = "\nEstablishing connction.....\n"; } catch ( NoSuchPortException noport) { System.out.println("Port not found: "+ noport); messages[0] = "Port not found: "+ noport+"\n"; } try { serialPort = (SerialPort) portId.open("serial", 50); System.out.println("Port has been found."); messages[1] = "Port has been found.\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[1] = "" +usedport; } try { serialPort = (SerialPort) portId.open("serial", 50); messages[2] = "Connecting to COM3 on port 50....\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; } try { serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); System.out.println("Esablishing the transfer rate settings for COM3."); messages[3] = "Esablishing the transfer rate settings for COM3.\n"; } catch (UnsupportedCommOperationException nosupcom) { System.out.println(nosupcom); System.out.println("The tranfer rate could not be esblished on COM3."); messages[3] = "The tranfer rate could not be esblished on COM3.\n"; } System.out.println(serialPort.getFlowControlMode()); messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; //sendDataOut(buffer[3],buffer[4]); } I need all the data in this method (and all the string values in this method) to be printed out on a JTextArea. I wont do me any good if not all the text is printed on a JTextArea in another class. So I have the text printing the JTextArea correctly, but everytime the JButton is activated - it gives me that error message. I did add a disconnect button that is supposed to call the serialPort.close(). _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/273fd4ec/attachment-0036.html From tjarvi at qbang.org Thu Apr 24 21:54:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Apr 2008 21:54:10 -0600 (MDT) Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > Hello I am having a problem with the serial device connecting (software > wise) to the serial port. However I have a test program and it seems to > work just fine in that environment - and it doesnt use GUI. The error I > am getting is : PortNotFoundException Now the way I have it setup in the > GUI environment is that once the user pushes a JButton the program > connects using this class: > > protected void establishConnection() { > try { > portId = CommPortIdentifier.getPortIdentifier("COM3"); > System.out.println("Establishing connction....."); > messages[0] = "\nEstablishing connction.....\n"; > } > catch ( NoSuchPortException noport) { > System.out.println("Port not found: "+ noport); > messages[0] = "Port not found: "+ noport+"\n"; > } > try { > serialPort = (SerialPort) portId.open("serial", 50); > System.out.println("Port has been found."); > messages[1] = "Port has been found.\n"; > } > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[1] = "" +usedport; > } ================================================================= > try { > serialPort = (SerialPort) portId.open("serial", 50); > messages[2] = "Connecting to COM3 on port 50....\n"; > } ================================================================== > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > } > try { > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > System.out.println("Esablishing the transfer rate settings for COM3."); > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > } > catch (UnsupportedCommOperationException nosupcom) { > System.out.println(nosupcom); > System.out.println("The tranfer rate could not be esblished on COM3."); > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > } > System.out.println(serialPort.getFlowControlMode()); > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > //sendDataOut(buffer[3],buffer[4]); > } > > I need all the data in this method (and all the string values in this > method) to be printed out on a JTextArea. I wont do me any good if not > all the text is printed on a JTextArea in another class. So I have the > text printing the JTextArea correctly, but everytime the JButton is > activated - it gives me that error message. I did add a disconnect > button that is supposed to call the serialPort.close(). > The open code used twice is going to throw an exception. It may be that you catch the exception above this code and print a confusing message? A common mistake is people will accidently run two copies of their program. The first instance of the program will open the port and prevent enumeration (finding the port) in the second instance of the program. As an example, you may be running your text based application which is preventing the GUI from seeing the port. Enumeration is done by trying to open the port. If the port is open, Enumeration fails. -- Trent Jarvi tjarvi at qbang.org From fire_baptized at hotmail.com Thu Apr 24 22:32:05 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 00:32:05 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Wow - thanks dude what a dumb thing for me to not catch..... now here is the current problem - right now I am trying to output data again one is with the test program - and it seems that serialPort.setRTS(true); is throwing an exceptions there - now if I show this code please bare in mind that I am only testing - the code is kinda sloppy in my mind - but if I can figure out why calling this function is throwing an exception then maybe I can figure out why my GUI application is getting the same null pointer exceptions when try to send out the data stream. FYI Trent this email is not directed towards you - anyone can jump in on this public static void main(String args[]) { byte[] b = new byte[64]; int keyinput = 0 ; byte x = 0; byte y = 0; PortTesting1 testports = new PortTesting1(); try { joyskoro = Joystick.createInstance(); } catch (IOException ioexc) { System.out.println("There is an input/output problem: " + ioexc); } while (true) { joyskoro.poll(); b[0] = ((byte) -(10 * joyskoro.getY())); b[1] = ((byte) (10 * joyskoro.getX())); System.out.println("The 3rd byte is: " +b[0]); System.out.println("The 4rd byte is: " +b[1]); serialPort.setRTS(true); // HERE IS WHERE THE PROBLEM IS !!!!!!! ON THIS LINE but if I dont have it active in my program the Bluetooth device (that is System.out.println("Ready to send :-) !"); //connected to the serial port does not send out data!!!!! if (joyskoro.isButtonDown(joyskoro.BUTTON10)) { System.out.println("Connection terminated."); serialPort.close(); break; } if (joyskoro.isButtonDown(joyskoro.BUTTON2)) { boolean flag = true; //reading from key input from the keyboard System.out.println("Please input a command: "); while (flag) { try { keyinput = System.in.read(); } catch (IOException ioexc) {/*there is no need to put * anything here */ } if((char)keyinput=='w') { pushIt((byte)85); } if((char)keyinput=='s') { pushIt((byte)84); } if((char)keyinput=='a') { pushIt((byte)83); } if((char)keyinput=='d') { pushIt((byte)82); } if((char)keyinput=='q') { pushIt((byte)89); } if((char)keyinput=='\t') { //this stop reading input from the keyboard flag = false; } } and help anyways here is the block of code that throwing an exception for the test program: > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/5c8f7d68/attachment-0036.html From fire_baptized at hotmail.com Fri Apr 25 07:59:53 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 09:59:53 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Are there any examples of how to push out data? As in using input and output streams - if I can compare code maybe I can see where this is causing a problem. I have a byte array that I am pushing out data. I keep getting null pointer exceptions every where I turn. > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/22228ab6/attachment-0035.html From ajmas at sympatico.ca Sat Apr 26 07:37:09 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 26 Apr 2008 09:37:09 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hi, On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote: > > Are there any examples of how to push out data? As in using input > and output streams - if I can compare code maybe I can see where > this is causing a problem. I have a byte array that I am pushing > out data. I keep getting null pointer exceptions every where I turn. > There are some examples here that might be of help: http://rxtx.qbang.org/wiki/index.php/Examples Andre From fire_baptized at hotmail.com Sat Apr 26 20:13:54 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Sat, 26 Apr 2008 22:13:54 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: looked at those....yep didnt help - I need to push out data with GUI and not get a null pointer exception everytime I try. > CC: rxtx at qbang.org> From: ajmas at sympatico.ca> To: fire_baptized at hotmail.com> Subject: Re: [Rxtx] Serial Problems with Gui.....> Date: Sat, 26 Apr 2008 09:37:09 -0400> > Hi,> > > On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote:> >> > Are there any examples of how to push out data? As in using input > > and output streams - if I can compare code maybe I can see where > > this is causing a problem. I have a byte array that I am pushing > > out data. I keep getting null pointer exceptions every where I turn.> >> > There are some examples here that might be of help:> > http://rxtx.qbang.org/wiki/index.php/Examples> > Andre _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080426/09f95b41/attachment-0034.html From michael.erskine at ketech.com Mon Apr 28 02:47:22 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 28 Apr 2008 09:47:22 +0100 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D426EF3CBBC5@no-sv-03.ketech.local> Jesrael D. Summerhill wrote: > looked at those....yep didnt help - I need to push out data with GUI and > not get a null pointer exception everytime I try. So it seems pretty obvious that your code needs to check for nulls wherever one may occur and report what's happening. Alternatively, catch the npe and display the stack trace. Then you can fix your code so it doesn't try to work with something that ain't there. Regards, Michael Erskine. From scldad at sdc.com.au Mon Apr 28 03:58:34 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Mon, 28 Apr 2008 19:28:34 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Message-ID: <200804281928.34454.scldad@sdc.com.au> Has anybody done any design work on this? The first thing that springs to mind is that we still need to check for lock files because other apps tend to use that approach even if we go to ioctl. Cheers, Stephen Davies On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > Thanks Trent. > > Problem is only that I'm really not at all > Familiar with the C part of RXTX. If there > Were anything I could do in Java for this, > It would be easier for me.... > > ... Are there any C experts here on the list > Who'd like to look at ioctl port locking > For linux? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > -----Original Message----- > > From: Trent Jarvi [mailto:tjarvi at qbang.org] > > Sent: Donnerstag, 24. April 2008 04:32 > > To: Oberhuber, Martin > > Cc: rxtx at qbang.org > > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > > > I'm wondering what the status is with RXTX locking > > > serial ports on Linux? > > > > > > My understanding is that the mechanism used in > > > 2.1-7r2 (lockfiles) is not really state of the art, and > > > has lots of problems (e.g. missing permissions). > > > > > > There was an idea to migrate towards a Kernel > > > syscall based solution for port locking. > > > > > > What's the status here? > > > > Hi Martin, > > > > I'm in favor of deprecating the current FHS locking mechanism > > in favor of > > an IOCTL when available. I think it will be available on all the > > platforms but do not know for sure. > > > > The status is unchanged. I've had very few free cycles for > > such things. > > Feel free to take a stab at it if you have some time. I > > believe the IOCTL > > is used in the Mac OS X code already. > > > > I don't see any real backwards compatability issues and the > > IOCTL should > > just work. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Mon Apr 28 04:21:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 28 Apr 2008 04:21:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804281928.34454.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: I don't think there would need to be any architectural changes. A couple ifdefs and minor changes in the current code should be enough. Proposal: FHS/UUCP locks: continue to respect them, try to create them but do not error if the IOCTL is supported. (But does the IOCTL being defined mean it will work?) Enumeration: Do not assert the IOCTL while opening. Serial.open: assert the IOCTL after open. Continue to use locks as described above after asserting the IOCTL. If the IOCTL is defined but not working, handle it here. Failure cases include the IOCTL is not supported and the port is already locked. On Mon, 28 Apr 2008, Stephen Davies wrote: > Has anybody done any design work on this? > The first thing that springs to mind is that we still need to check for lock > files because other apps tend to use that approach even if we go to ioctl. > > Cheers, > Stephen Davies > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: >> Thanks Trent. >> >> Problem is only that I'm really not at all >> Familiar with the C part of RXTX. If there >> Were anything I could do in Java for this, >> It would be easier for me.... >> >> ... Are there any C experts here on the list >> Who'd like to look at ioctl port locking >> For linux? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >>> -----Original Message----- >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] >>> Sent: Donnerstag, 24. April 2008 04:32 >>> To: Oberhuber, Martin >>> Cc: rxtx at qbang.org >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? >>> >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: >>>> Dear RXTX community, >>>> >>>> I'm wondering what the status is with RXTX locking >>>> serial ports on Linux? >>>> >>>> My understanding is that the mechanism used in >>>> 2.1-7r2 (lockfiles) is not really state of the art, and >>>> has lots of problems (e.g. missing permissions). >>>> >>>> There was an idea to migrate towards a Kernel >>>> syscall based solution for port locking. >>>> >>>> What's the status here? >>> >>> Hi Martin, >>> >>> I'm in favor of deprecating the current FHS locking mechanism >>> in favor of >>> an IOCTL when available. I think it will be available on all the >>> platforms but do not know for sure. >>> >>> The status is unchanged. I've had very few free cycles for >>> such things. >>> Feel free to take a stab at it if you have some time. I >>> believe the IOCTL >>> is used in the Mac OS X code already. >>> >>> I don't see any real backwards compatability issues and the >>> IOCTL should >>> just work. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Tue Apr 29 12:04:04 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Apr 2008 20:04:04 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Hi all, The biggest problem that I have seen with lockfiles on Linux At least is, that it seems there is no standard with respect To the folder in which they should be created. Also, many Distributions seem to set up file system permissions in such A way that writing to the lockfile folder is not allowed for The normal user -- that's why we stopped using lockfiles In our commercial product. If we are to still respect lockfiles, we first need to Understand where we are expected to look for them. Does Anybody have any insight what variants of lockfile folder Schema exist out there in the wild? Some apps like minicom Seem to even allow users to manually specify a lockfile Folder of their choice. Because of the difficulty finding the right lockfile folder, And because of the inherent risk of thinking that something Might be locked while it actually isn't, I'd suggest that RXTX should have a "soft-off" feature that allows disabling ALL Lockfile checks at runtime without recompiling the native Sharedlibs. Trent - I like your strategy outline, but I think that it Needs to be configurable by the client such that users and/or Customer Support can disable lockfiles / disable ioctl in Case they detect that they are runing on an OS / Kernal that Does not support one or the other. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Montag, 28. April 2008 12:22 > To: Stephen Davies > Cc: rxtx at qbang.org; Oberhuber, Martin; Trent Jarvi > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > I don't think there would need to be any architectural > changes. A couple > ifdefs and minor changes in the current code should be enough. > > Proposal: > > FHS/UUCP locks: > continue to respect them, try to create them but do not error if > the IOCTL is supported. (But does the IOCTL being defined mean > it will work?) > Enumeration: > Do not assert the IOCTL while opening. > Serial.open: > assert the IOCTL after open. Continue to use locks as described > above after asserting the IOCTL. If the IOCTL is defined but > not working, handle it here. Failure cases include the IOCTL > is not supported and the port is already locked. > > On Mon, 28 Apr 2008, Stephen Davies wrote: > > > Has anybody done any design work on this? > > The first thing that springs to mind is that we still need > to check for lock > > files because other apps tend to use that approach even if > we go to ioctl. > > > > Cheers, > > Stephen Davies > > > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > >> Thanks Trent. > >> > >> Problem is only that I'm really not at all > >> Familiar with the C part of RXTX. If there > >> Were anything I could do in Java for this, > >> It would be easier for me.... > >> > >> ... Are there any C experts here on the list > >> Who'd like to look at ioctl port locking > >> For linux? > >> > >> Thanks, > >> -- > >> Martin Oberhuber, Senior Member of Technical Staff, Wind River > >> Target Management Project Lead, DSDP PMC Member > >> http://www.eclipse.org/dsdp/tm > >> > >>> -----Original Message----- > >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] > >>> Sent: Donnerstag, 24. April 2008 04:32 > >>> To: Oberhuber, Martin > >>> Cc: rxtx at qbang.org > >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? > >>> > >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > >>>> Dear RXTX community, > >>>> > >>>> I'm wondering what the status is with RXTX locking > >>>> serial ports on Linux? > >>>> > >>>> My understanding is that the mechanism used in > >>>> 2.1-7r2 (lockfiles) is not really state of the art, and > >>>> has lots of problems (e.g. missing permissions). > >>>> > >>>> There was an idea to migrate towards a Kernel > >>>> syscall based solution for port locking. > >>>> > >>>> What's the status here? > >>> > >>> Hi Martin, > >>> > >>> I'm in favor of deprecating the current FHS locking mechanism > >>> in favor of > >>> an IOCTL when available. I think it will be available on all the > >>> platforms but do not know for sure. > >>> > >>> The status is unchanged. I've had very few free cycles for > >>> such things. > >>> Feel free to take a stab at it if you have some time. I > >>> believe the IOCTL > >>> is used in the Mac OS X code already. > >>> > >>> I don't see any real backwards compatability issues and the > >>> IOCTL should > >>> just work. > >>> > >>> -- > >>> Trent Jarvi > >>> tjarvi at qbang.org > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > From Steffen.DETTMER at ingenico.com Tue Apr 29 13:34:44 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 29 Apr 2008 21:34:44 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Message-ID: <20080429193444.GU2928@elberon.bln.de.ingenico.com> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > The biggest problem that I have seen with lockfiles on Linux > At least is, that it seems there is no standard with respect > To the folder in which they should be created. Also, many > Distributions seem to set up file system permissions in such > A way that writing to the lockfile folder is not allowed for > The normal user -- that's why we stopped using lockfiles > In our commercial product. It seems it depends on the expectations. I consider it as a feature that by default a linux user cannot access serial ports. Maybe root connected a modem (can produce phone bills) or even some serial card reader, maybe with the web servers key pair. I would expect that by default a user cannot open the serial port because of insufficient permissions on the device file. I would expect this on other unices as well (but I don't know it). For windows I think it should be similar but not impacting so much in practice, because often windows users work with big permissions on a somewhat high priviledge level or even Administrator. > If we are to still respect lockfiles, we first need to > Understand where we are expected to look for them. Does > Anybody have any insight what variants of lockfile folder > Schema exist out there in the wild? Some apps like minicom > Seem to even allow users to manually specify a lockfile > Folder of their choice. At least my (ancient) minicom does not allow the user to change this option, it is displayed but read-only, but root is allowed to change it. > Because of the difficulty finding the right lockfile folder, > And because of the inherent risk of thinking that something > Might be locked while it actually isn't, I'd suggest that > RXTX should have a "soft-off" feature that allows disabling > ALL Lockfile checks at runtime without recompiling the native > Sharedlibs. sounds very reasonable, yes... and as admin I would not wish that users could skip such locking because they do things wrong by default ;) (in the end I guess that is related to the dilemma, that hotplug/user-owned-periphery and multi-user systems simply conflict) > Trent - I like your strategy outline, but I think that it > Needs to be configurable by the client such that users and/or > Customer Support can disable lockfiles / disable ioctl in > Case they detect that they are runing on an OS / Kernal that > Does not support one or the other. Yes, this would be good I guess... Applications could offer configuration options to control that, maybe similarily as minicom. BTW, man minicom tells: *B - Lock file location On most systems This should be /usr/spool/uucp. Linux systems use /var/lock. If this directory does not exist, minicom will not attempt to use lockfiles. The statement `Linux systems use /var/lock' is interesting, does anyone know the source of this convention? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Tue Apr 29 16:11:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Apr 2008 16:11:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? These details are outlined in the Filesystem Hierarchy Standard (FHS). http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLOCKLOCKFILES -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Tue Apr 29 18:58:09 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Wed, 30 Apr 2008 10:28:09 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: <200804301028.09307.scldad@sdc.com.au> I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is the same. Any ideas as to how to handle this? Stephen On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: > * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > > The biggest problem that I have seen with lockfiles on Linux > > At least is, that it seems there is no standard with respect > > To the folder in which they should be created. Also, many > > Distributions seem to set up file system permissions in such > > A way that writing to the lockfile folder is not allowed for > > The normal user -- that's why we stopped using lockfiles > > In our commercial product. > > It seems it depends on the expectations. I consider it as a > feature that by default a linux user cannot access serial ports. > Maybe root connected a modem (can produce phone bills) or even > some serial card reader, maybe with the web servers key pair. > > I would expect that by default a user cannot open the serial port > because of insufficient permissions on the device file. I would > expect this on other unices as well (but I don't know it). > > For windows I think it should be similar but not impacting so > much in practice, because often windows users work with big > permissions on a somewhat high priviledge level or even > Administrator. > > > If we are to still respect lockfiles, we first need to > > Understand where we are expected to look for them. Does > > Anybody have any insight what variants of lockfile folder > > Schema exist out there in the wild? Some apps like minicom > > Seem to even allow users to manually specify a lockfile > > Folder of their choice. > > At least my (ancient) minicom does not allow the user to change > this option, it is displayed but read-only, but root is allowed > to change it. > > > Because of the difficulty finding the right lockfile folder, > > And because of the inherent risk of thinking that something > > Might be locked while it actually isn't, I'd suggest that > > RXTX should have a "soft-off" feature that allows disabling > > ALL Lockfile checks at runtime without recompiling the native > > Sharedlibs. > > sounds very reasonable, yes... > and as admin I would not wish that users could skip such > locking because they do things wrong by default ;) > > (in the end I guess that is related to the dilemma, that > hotplug/user-owned-periphery and multi-user systems simply > conflict) > > > Trent - I like your strategy outline, but I think that it > > Needs to be configurable by the client such that users and/or > > Customer Support can disable lockfiles / disable ioctl in > > Case they detect that they are runing on an OS / Kernal that > > Does not support one or the other. > > Yes, this would be good I guess... Applications could offer > configuration options to control that, maybe similarily as > minicom. > > BTW, man minicom tells: > > *B - Lock file location > On most systems This should be /usr/spool/uucp. > Linux systems use /var/lock. If this directory > does not exist, minicom will not attempt to use > lockfiles. > > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure > and expedient electronic transaction acceptance. Ingenico products leverage > proven technology, established standards and unparalleled ergonomics to > provide optimal reliability, versatility and usability. This comprehensive > range of products is complemented by a global array of services and > partnerships, enabling businesses in a number of vertical sectors to accept > transactions anywhere their business takes them. www.ingenico.com This > message may contain confidential and/or privileged information. If you are > not the addressee or authorized to receive this for the addressee, you must > not use, copy, disclose or take any action based on this message or any > information herein. If you have received this message in error, please > advise the sender immediately by reply e-mail and delete this message. > Thank you for your cooperation. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Wed Apr 30 19:30:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 30 Apr 2008 19:30:51 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804301028.09307.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> <200804301028.09307.scldad@sdc.com.au> Message-ID: Hi Stephen, I suspect ioctl/TIOCEXCL open/O_EXCL would do the job. Mac uses TIOCEXCL and it is POSIX. We use O_EXCL for lockfiles on Linux already. On Wed, 30 Apr 2008, Stephen Davies wrote: > I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is > the same. > > Any ideas as to how to handle this? > > Stephen > > > On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: >> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: >>> The biggest problem that I have seen with lockfiles on Linux >>> At least is, that it seems there is no standard with respect >>> To the folder in which they should be created. Also, many >>> Distributions seem to set up file system permissions in such >>> A way that writing to the lockfile folder is not allowed for >>> The normal user -- that's why we stopped using lockfiles >>> In our commercial product. >> >> It seems it depends on the expectations. I consider it as a >> feature that by default a linux user cannot access serial ports. >> Maybe root connected a modem (can produce phone bills) or even >> some serial card reader, maybe with the web servers key pair. >> >> I would expect that by default a user cannot open the serial port >> because of insufficient permissions on the device file. I would >> expect this on other unices as well (but I don't know it). >> >> For windows I think it should be similar but not impacting so >> much in practice, because often windows users work with big >> permissions on a somewhat high priviledge level or even >> Administrator. >> >>> If we are to still respect lockfiles, we first need to >>> Understand where we are expected to look for them. Does >>> Anybody have any insight what variants of lockfile folder >>> Schema exist out there in the wild? Some apps like minicom >>> Seem to even allow users to manually specify a lockfile >>> Folder of their choice. >> >> At least my (ancient) minicom does not allow the user to change >> this option, it is displayed but read-only, but root is allowed >> to change it. >> >>> Because of the difficulty finding the right lockfile folder, >>> And because of the inherent risk of thinking that something >>> Might be locked while it actually isn't, I'd suggest that >>> RXTX should have a "soft-off" feature that allows disabling >>> ALL Lockfile checks at runtime without recompiling the native >>> Sharedlibs. >> >> sounds very reasonable, yes... >> and as admin I would not wish that users could skip such >> locking because they do things wrong by default ;) >> >> (in the end I guess that is related to the dilemma, that >> hotplug/user-owned-periphery and multi-user systems simply >> conflict) >> >>> Trent - I like your strategy outline, but I think that it >>> Needs to be configurable by the client such that users and/or >>> Customer Support can disable lockfiles / disable ioctl in >>> Case they detect that they are runing on an OS / Kernal that >>> Does not support one or the other. >> >> Yes, this would be good I guess... Applications could offer >> configuration options to control that, maybe similarily as >> minicom. >> >> BTW, man minicom tells: >> >> *B - Lock file location >> On most systems This should be /usr/spool/uucp. >> Linux systems use /var/lock. If this directory >> does not exist, minicom will not attempt to use >> lockfiles. >> >> The statement `Linux systems use /var/lock' is interesting, does >> anyone know the source of this convention? >> >> oki, >> >> Steffen >> >> About Ingenico Throughout the world businesses rely on Ingenico for secure >> and expedient electronic transaction acceptance. Ingenico products leverage >> proven technology, established standards and unparalleled ergonomics to >> provide optimal reliability, versatility and usability. This comprehensive >> range of products is complemented by a global array of services and >> partnerships, enabling businesses in a number of vertical sectors to accept >> transactions anywhere their business takes them. www.ingenico.com This >> message may contain confidential and/or privileged information. If you are >> not the addressee or authorized to receive this for the addressee, you must >> not use, copy, disclose or take any action based on this message or any >> information herein. If you have received this message in error, please >> advise the sender immediately by reply e-mail and delete this message. >> Thank you for your cooperation. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0060.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0058.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0045.html From pboulton at pulsetracer.com Fri Apr 18 14:30:13 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Fri, 18 Apr 2008 13:30:13 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site Message-ID: <480904D5.1060307@pulsetracer.com> Hello, gentle serial porters. I have downloaded the zipped up binaries for use on Windows without Sun's CommAPI, but don't seem able to extract anything from the download. Go to main page, http://www.rxtx.org/ Click on Downloads I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) And I save it to disk. If I try and extract the files with WinZip, Winzip thinks the archive is corrupt. If I try using Windows Explorer, I am able to extract it into a single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than the original .zip. Any help would be much appreciated. Sincerely, Philip Boulton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080418/97d89793/attachment-0043.html From tjarvi at qbang.org Fri Apr 18 19:07:00 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 18 Apr 2008 19:07:00 -0600 (MDT) Subject: [Rxtx] Difficulty opening zip file at rxtx site In-Reply-To: <480904D5.1060307@pulsetracer.com> References: <480904D5.1060307@pulsetracer.com> Message-ID: On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org From pboulton at pulsetracer.com Sat Apr 19 12:46:26 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Sat, 19 Apr 2008 11:46:26 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site References: <480904D5.1060307@pulsetracer.com> Message-ID: <53DB7576450695419E09299104043761A78533@ZTGSERVER.ztg.local> I have been able to get my hands on the binaries, by going to the ftp directory /pub/rxtx at ftp.qbang.org,, and ftping the file rxtx-2.1-7-bins-r2.zip . This opens happily with Winzip, and extracts as the set of files that you describe below. I only experience the ill-formed archive problem by clicking the link on the rxtx.org Downloads page (http://rxtx.qbang.org/pub/rxtx/ rxtx-2.1-7-bins-r2.zip ). Not sure what to make of that. Philip Boulton ________________________________ From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Fri 4/18/2008 6:07 PM To: Philip Boulton Cc: rxtx at qbang.org Subject: Re: [Rxtx] Difficulty opening zip file at rxtx site On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080419/147923bb/attachment-0042.html From jlar310 at gmail.com Sat Apr 19 19:11:55 2008 From: jlar310 at gmail.com (Jeff Larsen) Date: Sat, 19 Apr 2008 20:11:55 -0500 Subject: [Rxtx] Moxa serial over Ethernet driver Message-ID: Hi all, I've been using javax.comm for years to communicate with a legacy radio data system. We want to migrate the java side of the system to a VMware Server virtual machine. We've had great success using Moxa DE-303 and 5610 serial over Ethernet appliances and virtual machines for running hylafax. The OS (Linux in this case) uses a kernel driver to communicate with the Moxa via a virtual serial port such as /dev/ttyr00. I want to do the same thing with javax.comm or gnu.io to connect to a virtual serial port. However I'm hitting road blocks everywhere. javax.comm for Linux sees the virtual port, but there are transmission errors. Tried Solaris too, but the Solaris Moxa drivers don't play nice with javax.comm because the driver uses /dev/pts/n instead of /dev/term/x. Next I tried RXTX on Linux, but I'm getting NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX on Solaris. Has anyone used RXTX with serial over Ethernet devices? Any hints on how to make it work? I know that I'm not completely off track because javax.comm does work with Moxa on a Windows platform, but that's just not an option for production deployment. -- Jeff From tjarvi at qbang.org Sat Apr 19 21:08:41 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 19 Apr 2008 21:08:41 -0600 (MDT) Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: yOn Sat, 19 Apr 2008, Jeff Larsen wrote: > Hi all, > > I've been using javax.comm for years to communicate with a legacy > radio data system. We want to migrate the java side of the system to a > VMware Server virtual machine. We've had great success using Moxa > DE-303 and 5610 serial over Ethernet appliances and virtual machines > for running hylafax. The OS (Linux in this case) uses a kernel driver > to communicate with the Moxa via a virtual serial port such as > /dev/ttyr00. > > I want to do the same thing with javax.comm or gnu.io to connect to a > virtual serial port. However I'm hitting road blocks everywhere. > javax.comm for Linux sees the virtual port, but there are transmission > errors. Tried Solaris too, but the Solaris Moxa drivers don't play > nice with javax.comm because the driver uses /dev/pts/n instead of > /dev/term/x. Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris. > > Has anyone used RXTX with serial over Ethernet devices? Any hints on > how to make it work? > > I know that I'm not completely off track because javax.comm does work > with Moxa on a Windows platform, but that's just not an option for > production deployment. > > Moxa should work under linux. There may be minor issues depending upon how complete the kernel driver is but I think it will work. One of the minor issues is /dev/ttyr00 is not enumerated. There are several work arounds documented with the source code and on the wiki. The easiest solution for testing purposes is to make a symbolic link from /dev/ttyr00 to a port that is enumerated such as /dev/ttyS129. You can later alter the rxtx source or use properties to change the enumerated ports. -- Trent Jarvi tjarvi at qbang.org From d.tonhofer at m-plify.com Sun Apr 20 03:33:30 2008 From: d.tonhofer at m-plify.com (David Tonhofer (M-PLIFY S.A.)) Date: Sun, 20 Apr 2008 11:33:30 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: <480B0DEA.5010908@m-plify.com> Jeff Larsen wrote: > Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris It might be that the Java side of RXTX does not recognize that portname. Trying modifying src/RXTXCommDriver.java as described in this case: http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card From ajmas at sympatico.ca Sun Apr 20 16:37:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Apr 2008 18:37:59 -0400 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <480B0DEA.5010908@m-plify.com> References: <480B0DEA.5010908@m-plify.com> Message-ID: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > Jeff Larsen wrote: >> Next I tried RXTX on Linux, but I'm getting >> NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX >> on Solaris > It might be that the Java side of RXTX does not recognize that > portname. > Trying modifying src/RXTXCommDriver.java as described in this case: > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card I wonder whether it would be worth allowing custom port prefixes as a system parameter? For example: gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" Andre From Martin.Oberhuber at windriver.com Tue Apr 22 12:34:36 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 22 Apr 2008 20:34:36 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> References: <480B0DEA.5010908@m-plify.com> <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE6485848056CD6CE@ism-mail03.corp.ad.wrs.com> Sounds like a great idea... I'm wondering how the "variable part" after the Prefixes could be specified though? What about allowing Regular Expression character Classes in the existing System Property for specifying ports: System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyS[0-9],ttyS[ABC],ttyUSB[0-9a-z]"); The set of allowed patterns would of course need to Be restricted compared to REGEX, because it must be A syntax that supports iterating over it. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Montag, 21. April 2008 00:38 > To: rxtx at qbang.org and Users > Subject: Re: [Rxtx] Moxa serial over Ethernet driver > > > On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > > Jeff Larsen wrote: > >> Next I tried RXTX on Linux, but I'm getting > >> NoSuchPortException connecting to /dev/ttyr00. I have yet > to try RXTX > >> on Solaris > > It might be that the Java side of RXTX does not recognize that > > portname. > > Trying modifying src/RXTXCommDriver.java as described in this case: > > > > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_ > SST-4P.2FLP_multiport_card > > I wonder whether it would be worth allowing custom port > prefixes as a > system parameter? For > example: > > gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Loi.TRAN at weatherford.com Tue Apr 22 13:10:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Tue, 22 Apr 2008 14:10:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled Message-ID: Hi, I'm currently using the Java RXTX API to interface to a serial port. The serial port is connected to a bridge board that communicates with our communications system running at 1.875 Mbps which is linked to an embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no flow control). I send a command to the embedded board through the serial-bridge board which then is relayed to the embedded board. The command sent asks the embedded board to dump a binary image. Here's where I'm hitting some problems. I've successfully done this is an integrated serial port from the laptop. The binary file that comes back is consistent on every attempt. When I use the application I've written to do the same thing with a USB-to-serial adapter, the image I get back is not the same as the image I receive through the USB-to-serial adapter is not consistent at all. A final thing is that when I use a terminal program to dump the binary image with the USB-serial adapter, the image is correct. Every time! What is the terminal program doing that's not being done in my application? My application is quite simple. Has anyone observed this behavior before? If you have, I'd like to know how you've gotten around this problem. Thanks, LT =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From tjarvi at qbang.org Tue Apr 22 21:11:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 22 Apr 2008 21:11:10 -0600 (MDT) Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org From Loi.TRAN at weatherford.com Wed Apr 23 08:35:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Wed, 23 Apr 2008 09:35:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: Thanks for all the responses. I finally tried something that worked consistently. I updated my Prolific driver and repeated my tests. It worked. If you're using the Prolific type USB-serial adapters, do no use the Prolific version 2.0.2.1 driver on Windows. Update it to the latest 2.0.2.8 version. Again, thanks for all the responses. LT -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Tuesday, April 22, 2008 10:11 PM To: TRAN, Loi X. Cc: rxtx at qbang.org Subject: Re: [Rxtx] Prolific USB - RXTX data mangled On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From Martin.Oberhuber at windriver.com Wed Apr 23 18:54:26 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 02:54:26 +0200 Subject: [Rxtx] RXTX port locking on Linux status? Message-ID: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Dear RXTX community, I'm wondering what the status is with RXTX locking serial ports on Linux? My understanding is that the mechanism used in 2.1-7r2 (lockfiles) is not really state of the art, and has lots of problems (e.g. missing permissions). There was an idea to migrate towards a Kernel syscall based solution for port locking. What's the status here? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/9878db9f/attachment-0038.html From tjarvi at qbang.org Wed Apr 23 20:32:24 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Apr 2008 20:32:24 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > Dear RXTX community, > > I'm wondering what the status is with RXTX locking > serial ports on Linux? > > My understanding is that the mechanism used in > 2.1-7r2 (lockfiles) is not really state of the art, and > has lots of problems (e.g. missing permissions). > > There was an idea to migrate towards a Kernel > syscall based solution for port locking. > > What's the status here? > Hi Martin, I'm in favor of deprecating the current FHS locking mechanism in favor of an IOCTL when available. I think it will be available on all the platforms but do not know for sure. The status is unchanged. I've had very few free cycles for such things. Feel free to take a stab at it if you have some time. I believe the IOCTL is used in the Mac OS X code already. I don't see any real backwards compatability issues and the IOCTL should just work. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Apr 24 06:14:06 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 14:14:06 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Thanks Trent. Problem is only that I'm really not at all Familiar with the C part of RXTX. If there Were anything I could do in Java for this, It would be easier for me.... ... Are there any C experts here on the list Who'd like to look at ioctl port locking For linux? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Donnerstag, 24. April 2008 04:32 > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > I'm wondering what the status is with RXTX locking > > serial ports on Linux? > > > > My understanding is that the mechanism used in > > 2.1-7r2 (lockfiles) is not really state of the art, and > > has lots of problems (e.g. missing permissions). > > > > There was an idea to migrate towards a Kernel > > syscall based solution for port locking. > > > > What's the status here? > > > > Hi Martin, > > I'm in favor of deprecating the current FHS locking mechanism > in favor of > an IOCTL when available. I think it will be available on all the > platforms but do not know for sure. > > The status is unchanged. I've had very few free cycles for > such things. > Feel free to take a stab at it if you have some time. I > believe the IOCTL > is used in the Mac OS X code already. > > I don't see any real backwards compatability issues and the > IOCTL should > just work. > > -- > Trent Jarvi > tjarvi at qbang.org > From sspies at sloc.de Thu Apr 24 07:15:36 2008 From: sspies at sloc.de (Sebastian Spies) Date: Thu, 24 Apr 2008 15:15:36 +0200 (CEST) Subject: [Rxtx] rxtx on gumstix: Interrupted system call In-Reply-To: <47FB7B20.7080504@sloc.de> References: <47FB7B20.7080504@sloc.de> Message-ID: <55445.130.83.139.205.1209042936.squirrel@ssl.sloc.de> Dear list, while porting rxtx to the gumstix, I found out, that select used in readArray in SerialImp.c might not work as expected. Maybe, because of missing TIOCSERGETLSR-support? select is often interrupted, so i wrote the following quick'n'dirty hack to make it work on gumstix: diff -Nur rxtx-2.1-7r2/src/SerialImp.c rxtx-2.1-7r2/src/SerialImp.c --- rxtx-2.1-7r2/src/SerialImp.c 2006-01-29 23:19:04.000000000 +0100 +++ rxtx-2.1-7r2-patched/src/SerialImp.c 2008-04-24 14:30:17.000000000 +0200 @@ -3380,7 +3381,7 @@ JNIEXPORT jint JNICALL RXTXPort(readArray)( JNIEnv *env, jobject jobj, jbyteArray jbarray, jint offset, jint length ) { - int bytes; + int bytes = 0; jbyte *body; /* char msg[80]; */ int fd = get_java_var( env, jobj, "fd", "I" ); @@ -3397,9 +3398,18 @@ "readArray", "Invalid length" ); return -1; } - body = (*env)->GetByteArrayElements( env, jbarray, 0 ); - bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ - (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + while(1 > bytes) + { + body = (*env)->GetByteArrayElements( env, jbarray, 0 ); + bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ + (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + // quick'n'dirty - SSP + report (" trying again... \n"); + errno = 0; + } + if( bytes < 0 ) { report( "RXTXPort:readArray bytes < 0" ); LEAVE( "RXTXPort:readArray" ); > Hey, > > I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use > RXTXPort$SerialInputStream.read(), then I get the following Exception. I > did not yet figure out which system call is interrupted as strace > produces loads of output. > > Any help would be very appreciated. Thanks in advance. > Sebastian > > > [java] java.io.IOException: Interrupted system call in readArray > [java] at gnu.io.RXTXPort.readArray(Native Method) > [java] at > gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) > [java] at > java.io.FilterInputStream.read(FilterInputStream.java:189) > [java] at > java.io.BufferedInputStream.refill(BufferedInputStream.java:371) > [java] at > java.io.BufferedInputStream.read(BufferedInputStream.java:229) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) > [java] at > com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) > > -- > Sebastian Spies > > mail: sspies at sloc.de > > > > From fire_baptized at hotmail.com Thu Apr 24 18:27:48 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Thu, 24 Apr 2008 20:27:48 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hello I am having a problem with the serial device connecting (software wise) to the serial port. However I have a test program and it seems to work just fine in that environment - and it doesnt use GUI. The error I am getting is : PortNotFoundException Now the way I have it setup in the GUI environment is that once the user pushes a JButton the program connects using this class: protected void establishConnection() { try { portId = CommPortIdentifier.getPortIdentifier("COM3"); System.out.println("Establishing connction....."); messages[0] = "\nEstablishing connction.....\n"; } catch ( NoSuchPortException noport) { System.out.println("Port not found: "+ noport); messages[0] = "Port not found: "+ noport+"\n"; } try { serialPort = (SerialPort) portId.open("serial", 50); System.out.println("Port has been found."); messages[1] = "Port has been found.\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[1] = "" +usedport; } try { serialPort = (SerialPort) portId.open("serial", 50); messages[2] = "Connecting to COM3 on port 50....\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; } try { serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); System.out.println("Esablishing the transfer rate settings for COM3."); messages[3] = "Esablishing the transfer rate settings for COM3.\n"; } catch (UnsupportedCommOperationException nosupcom) { System.out.println(nosupcom); System.out.println("The tranfer rate could not be esblished on COM3."); messages[3] = "The tranfer rate could not be esblished on COM3.\n"; } System.out.println(serialPort.getFlowControlMode()); messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; //sendDataOut(buffer[3],buffer[4]); } I need all the data in this method (and all the string values in this method) to be printed out on a JTextArea. I wont do me any good if not all the text is printed on a JTextArea in another class. So I have the text printing the JTextArea correctly, but everytime the JButton is activated - it gives me that error message. I did add a disconnect button that is supposed to call the serialPort.close(). _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/273fd4ec/attachment-0037.html From tjarvi at qbang.org Thu Apr 24 21:54:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Apr 2008 21:54:10 -0600 (MDT) Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > Hello I am having a problem with the serial device connecting (software > wise) to the serial port. However I have a test program and it seems to > work just fine in that environment - and it doesnt use GUI. The error I > am getting is : PortNotFoundException Now the way I have it setup in the > GUI environment is that once the user pushes a JButton the program > connects using this class: > > protected void establishConnection() { > try { > portId = CommPortIdentifier.getPortIdentifier("COM3"); > System.out.println("Establishing connction....."); > messages[0] = "\nEstablishing connction.....\n"; > } > catch ( NoSuchPortException noport) { > System.out.println("Port not found: "+ noport); > messages[0] = "Port not found: "+ noport+"\n"; > } > try { > serialPort = (SerialPort) portId.open("serial", 50); > System.out.println("Port has been found."); > messages[1] = "Port has been found.\n"; > } > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[1] = "" +usedport; > } ================================================================= > try { > serialPort = (SerialPort) portId.open("serial", 50); > messages[2] = "Connecting to COM3 on port 50....\n"; > } ================================================================== > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > } > try { > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > System.out.println("Esablishing the transfer rate settings for COM3."); > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > } > catch (UnsupportedCommOperationException nosupcom) { > System.out.println(nosupcom); > System.out.println("The tranfer rate could not be esblished on COM3."); > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > } > System.out.println(serialPort.getFlowControlMode()); > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > //sendDataOut(buffer[3],buffer[4]); > } > > I need all the data in this method (and all the string values in this > method) to be printed out on a JTextArea. I wont do me any good if not > all the text is printed on a JTextArea in another class. So I have the > text printing the JTextArea correctly, but everytime the JButton is > activated - it gives me that error message. I did add a disconnect > button that is supposed to call the serialPort.close(). > The open code used twice is going to throw an exception. It may be that you catch the exception above this code and print a confusing message? A common mistake is people will accidently run two copies of their program. The first instance of the program will open the port and prevent enumeration (finding the port) in the second instance of the program. As an example, you may be running your text based application which is preventing the GUI from seeing the port. Enumeration is done by trying to open the port. If the port is open, Enumeration fails. -- Trent Jarvi tjarvi at qbang.org From fire_baptized at hotmail.com Thu Apr 24 22:32:05 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 00:32:05 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Wow - thanks dude what a dumb thing for me to not catch..... now here is the current problem - right now I am trying to output data again one is with the test program - and it seems that serialPort.setRTS(true); is throwing an exceptions there - now if I show this code please bare in mind that I am only testing - the code is kinda sloppy in my mind - but if I can figure out why calling this function is throwing an exception then maybe I can figure out why my GUI application is getting the same null pointer exceptions when try to send out the data stream. FYI Trent this email is not directed towards you - anyone can jump in on this public static void main(String args[]) { byte[] b = new byte[64]; int keyinput = 0 ; byte x = 0; byte y = 0; PortTesting1 testports = new PortTesting1(); try { joyskoro = Joystick.createInstance(); } catch (IOException ioexc) { System.out.println("There is an input/output problem: " + ioexc); } while (true) { joyskoro.poll(); b[0] = ((byte) -(10 * joyskoro.getY())); b[1] = ((byte) (10 * joyskoro.getX())); System.out.println("The 3rd byte is: " +b[0]); System.out.println("The 4rd byte is: " +b[1]); serialPort.setRTS(true); // HERE IS WHERE THE PROBLEM IS !!!!!!! ON THIS LINE but if I dont have it active in my program the Bluetooth device (that is System.out.println("Ready to send :-) !"); //connected to the serial port does not send out data!!!!! if (joyskoro.isButtonDown(joyskoro.BUTTON10)) { System.out.println("Connection terminated."); serialPort.close(); break; } if (joyskoro.isButtonDown(joyskoro.BUTTON2)) { boolean flag = true; //reading from key input from the keyboard System.out.println("Please input a command: "); while (flag) { try { keyinput = System.in.read(); } catch (IOException ioexc) {/*there is no need to put * anything here */ } if((char)keyinput=='w') { pushIt((byte)85); } if((char)keyinput=='s') { pushIt((byte)84); } if((char)keyinput=='a') { pushIt((byte)83); } if((char)keyinput=='d') { pushIt((byte)82); } if((char)keyinput=='q') { pushIt((byte)89); } if((char)keyinput=='\t') { //this stop reading input from the keyboard flag = false; } } and help anyways here is the block of code that throwing an exception for the test program: > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/5c8f7d68/attachment-0037.html From fire_baptized at hotmail.com Fri Apr 25 07:59:53 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 09:59:53 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Are there any examples of how to push out data? As in using input and output streams - if I can compare code maybe I can see where this is causing a problem. I have a byte array that I am pushing out data. I keep getting null pointer exceptions every where I turn. > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/22228ab6/attachment-0036.html From ajmas at sympatico.ca Sat Apr 26 07:37:09 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 26 Apr 2008 09:37:09 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hi, On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote: > > Are there any examples of how to push out data? As in using input > and output streams - if I can compare code maybe I can see where > this is causing a problem. I have a byte array that I am pushing > out data. I keep getting null pointer exceptions every where I turn. > There are some examples here that might be of help: http://rxtx.qbang.org/wiki/index.php/Examples Andre From fire_baptized at hotmail.com Sat Apr 26 20:13:54 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Sat, 26 Apr 2008 22:13:54 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: looked at those....yep didnt help - I need to push out data with GUI and not get a null pointer exception everytime I try. > CC: rxtx at qbang.org> From: ajmas at sympatico.ca> To: fire_baptized at hotmail.com> Subject: Re: [Rxtx] Serial Problems with Gui.....> Date: Sat, 26 Apr 2008 09:37:09 -0400> > Hi,> > > On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote:> >> > Are there any examples of how to push out data? As in using input > > and output streams - if I can compare code maybe I can see where > > this is causing a problem. I have a byte array that I am pushing > > out data. I keep getting null pointer exceptions every where I turn.> >> > There are some examples here that might be of help:> > http://rxtx.qbang.org/wiki/index.php/Examples> > Andre _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080426/09f95b41/attachment-0035.html From michael.erskine at ketech.com Mon Apr 28 02:47:22 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 28 Apr 2008 09:47:22 +0100 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D426EF3CBBC5@no-sv-03.ketech.local> Jesrael D. Summerhill wrote: > looked at those....yep didnt help - I need to push out data with GUI and > not get a null pointer exception everytime I try. So it seems pretty obvious that your code needs to check for nulls wherever one may occur and report what's happening. Alternatively, catch the npe and display the stack trace. Then you can fix your code so it doesn't try to work with something that ain't there. Regards, Michael Erskine. From scldad at sdc.com.au Mon Apr 28 03:58:34 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Mon, 28 Apr 2008 19:28:34 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Message-ID: <200804281928.34454.scldad@sdc.com.au> Has anybody done any design work on this? The first thing that springs to mind is that we still need to check for lock files because other apps tend to use that approach even if we go to ioctl. Cheers, Stephen Davies On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > Thanks Trent. > > Problem is only that I'm really not at all > Familiar with the C part of RXTX. If there > Were anything I could do in Java for this, > It would be easier for me.... > > ... Are there any C experts here on the list > Who'd like to look at ioctl port locking > For linux? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > -----Original Message----- > > From: Trent Jarvi [mailto:tjarvi at qbang.org] > > Sent: Donnerstag, 24. April 2008 04:32 > > To: Oberhuber, Martin > > Cc: rxtx at qbang.org > > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > > > I'm wondering what the status is with RXTX locking > > > serial ports on Linux? > > > > > > My understanding is that the mechanism used in > > > 2.1-7r2 (lockfiles) is not really state of the art, and > > > has lots of problems (e.g. missing permissions). > > > > > > There was an idea to migrate towards a Kernel > > > syscall based solution for port locking. > > > > > > What's the status here? > > > > Hi Martin, > > > > I'm in favor of deprecating the current FHS locking mechanism > > in favor of > > an IOCTL when available. I think it will be available on all the > > platforms but do not know for sure. > > > > The status is unchanged. I've had very few free cycles for > > such things. > > Feel free to take a stab at it if you have some time. I > > believe the IOCTL > > is used in the Mac OS X code already. > > > > I don't see any real backwards compatability issues and the > > IOCTL should > > just work. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Mon Apr 28 04:21:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 28 Apr 2008 04:21:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804281928.34454.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: I don't think there would need to be any architectural changes. A couple ifdefs and minor changes in the current code should be enough. Proposal: FHS/UUCP locks: continue to respect them, try to create them but do not error if the IOCTL is supported. (But does the IOCTL being defined mean it will work?) Enumeration: Do not assert the IOCTL while opening. Serial.open: assert the IOCTL after open. Continue to use locks as described above after asserting the IOCTL. If the IOCTL is defined but not working, handle it here. Failure cases include the IOCTL is not supported and the port is already locked. On Mon, 28 Apr 2008, Stephen Davies wrote: > Has anybody done any design work on this? > The first thing that springs to mind is that we still need to check for lock > files because other apps tend to use that approach even if we go to ioctl. > > Cheers, > Stephen Davies > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: >> Thanks Trent. >> >> Problem is only that I'm really not at all >> Familiar with the C part of RXTX. If there >> Were anything I could do in Java for this, >> It would be easier for me.... >> >> ... Are there any C experts here on the list >> Who'd like to look at ioctl port locking >> For linux? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >>> -----Original Message----- >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] >>> Sent: Donnerstag, 24. April 2008 04:32 >>> To: Oberhuber, Martin >>> Cc: rxtx at qbang.org >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? >>> >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: >>>> Dear RXTX community, >>>> >>>> I'm wondering what the status is with RXTX locking >>>> serial ports on Linux? >>>> >>>> My understanding is that the mechanism used in >>>> 2.1-7r2 (lockfiles) is not really state of the art, and >>>> has lots of problems (e.g. missing permissions). >>>> >>>> There was an idea to migrate towards a Kernel >>>> syscall based solution for port locking. >>>> >>>> What's the status here? >>> >>> Hi Martin, >>> >>> I'm in favor of deprecating the current FHS locking mechanism >>> in favor of >>> an IOCTL when available. I think it will be available on all the >>> platforms but do not know for sure. >>> >>> The status is unchanged. I've had very few free cycles for >>> such things. >>> Feel free to take a stab at it if you have some time. I >>> believe the IOCTL >>> is used in the Mac OS X code already. >>> >>> I don't see any real backwards compatability issues and the >>> IOCTL should >>> just work. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Tue Apr 29 12:04:04 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Apr 2008 20:04:04 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Hi all, The biggest problem that I have seen with lockfiles on Linux At least is, that it seems there is no standard with respect To the folder in which they should be created. Also, many Distributions seem to set up file system permissions in such A way that writing to the lockfile folder is not allowed for The normal user -- that's why we stopped using lockfiles In our commercial product. If we are to still respect lockfiles, we first need to Understand where we are expected to look for them. Does Anybody have any insight what variants of lockfile folder Schema exist out there in the wild? Some apps like minicom Seem to even allow users to manually specify a lockfile Folder of their choice. Because of the difficulty finding the right lockfile folder, And because of the inherent risk of thinking that something Might be locked while it actually isn't, I'd suggest that RXTX should have a "soft-off" feature that allows disabling ALL Lockfile checks at runtime without recompiling the native Sharedlibs. Trent - I like your strategy outline, but I think that it Needs to be configurable by the client such that users and/or Customer Support can disable lockfiles / disable ioctl in Case they detect that they are runing on an OS / Kernal that Does not support one or the other. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Montag, 28. April 2008 12:22 > To: Stephen Davies > Cc: rxtx at qbang.org; Oberhuber, Martin; Trent Jarvi > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > I don't think there would need to be any architectural > changes. A couple > ifdefs and minor changes in the current code should be enough. > > Proposal: > > FHS/UUCP locks: > continue to respect them, try to create them but do not error if > the IOCTL is supported. (But does the IOCTL being defined mean > it will work?) > Enumeration: > Do not assert the IOCTL while opening. > Serial.open: > assert the IOCTL after open. Continue to use locks as described > above after asserting the IOCTL. If the IOCTL is defined but > not working, handle it here. Failure cases include the IOCTL > is not supported and the port is already locked. > > On Mon, 28 Apr 2008, Stephen Davies wrote: > > > Has anybody done any design work on this? > > The first thing that springs to mind is that we still need > to check for lock > > files because other apps tend to use that approach even if > we go to ioctl. > > > > Cheers, > > Stephen Davies > > > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > >> Thanks Trent. > >> > >> Problem is only that I'm really not at all > >> Familiar with the C part of RXTX. If there > >> Were anything I could do in Java for this, > >> It would be easier for me.... > >> > >> ... Are there any C experts here on the list > >> Who'd like to look at ioctl port locking > >> For linux? > >> > >> Thanks, > >> -- > >> Martin Oberhuber, Senior Member of Technical Staff, Wind River > >> Target Management Project Lead, DSDP PMC Member > >> http://www.eclipse.org/dsdp/tm > >> > >>> -----Original Message----- > >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] > >>> Sent: Donnerstag, 24. April 2008 04:32 > >>> To: Oberhuber, Martin > >>> Cc: rxtx at qbang.org > >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? > >>> > >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > >>>> Dear RXTX community, > >>>> > >>>> I'm wondering what the status is with RXTX locking > >>>> serial ports on Linux? > >>>> > >>>> My understanding is that the mechanism used in > >>>> 2.1-7r2 (lockfiles) is not really state of the art, and > >>>> has lots of problems (e.g. missing permissions). > >>>> > >>>> There was an idea to migrate towards a Kernel > >>>> syscall based solution for port locking. > >>>> > >>>> What's the status here? > >>> > >>> Hi Martin, > >>> > >>> I'm in favor of deprecating the current FHS locking mechanism > >>> in favor of > >>> an IOCTL when available. I think it will be available on all the > >>> platforms but do not know for sure. > >>> > >>> The status is unchanged. I've had very few free cycles for > >>> such things. > >>> Feel free to take a stab at it if you have some time. I > >>> believe the IOCTL > >>> is used in the Mac OS X code already. > >>> > >>> I don't see any real backwards compatability issues and the > >>> IOCTL should > >>> just work. > >>> > >>> -- > >>> Trent Jarvi > >>> tjarvi at qbang.org > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > From Steffen.DETTMER at ingenico.com Tue Apr 29 13:34:44 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 29 Apr 2008 21:34:44 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Message-ID: <20080429193444.GU2928@elberon.bln.de.ingenico.com> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > The biggest problem that I have seen with lockfiles on Linux > At least is, that it seems there is no standard with respect > To the folder in which they should be created. Also, many > Distributions seem to set up file system permissions in such > A way that writing to the lockfile folder is not allowed for > The normal user -- that's why we stopped using lockfiles > In our commercial product. It seems it depends on the expectations. I consider it as a feature that by default a linux user cannot access serial ports. Maybe root connected a modem (can produce phone bills) or even some serial card reader, maybe with the web servers key pair. I would expect that by default a user cannot open the serial port because of insufficient permissions on the device file. I would expect this on other unices as well (but I don't know it). For windows I think it should be similar but not impacting so much in practice, because often windows users work with big permissions on a somewhat high priviledge level or even Administrator. > If we are to still respect lockfiles, we first need to > Understand where we are expected to look for them. Does > Anybody have any insight what variants of lockfile folder > Schema exist out there in the wild? Some apps like minicom > Seem to even allow users to manually specify a lockfile > Folder of their choice. At least my (ancient) minicom does not allow the user to change this option, it is displayed but read-only, but root is allowed to change it. > Because of the difficulty finding the right lockfile folder, > And because of the inherent risk of thinking that something > Might be locked while it actually isn't, I'd suggest that > RXTX should have a "soft-off" feature that allows disabling > ALL Lockfile checks at runtime without recompiling the native > Sharedlibs. sounds very reasonable, yes... and as admin I would not wish that users could skip such locking because they do things wrong by default ;) (in the end I guess that is related to the dilemma, that hotplug/user-owned-periphery and multi-user systems simply conflict) > Trent - I like your strategy outline, but I think that it > Needs to be configurable by the client such that users and/or > Customer Support can disable lockfiles / disable ioctl in > Case they detect that they are runing on an OS / Kernal that > Does not support one or the other. Yes, this would be good I guess... Applications could offer configuration options to control that, maybe similarily as minicom. BTW, man minicom tells: *B - Lock file location On most systems This should be /usr/spool/uucp. Linux systems use /var/lock. If this directory does not exist, minicom will not attempt to use lockfiles. The statement `Linux systems use /var/lock' is interesting, does anyone know the source of this convention? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Tue Apr 29 16:11:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Apr 2008 16:11:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? These details are outlined in the Filesystem Hierarchy Standard (FHS). http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLOCKLOCKFILES -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Tue Apr 29 18:58:09 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Wed, 30 Apr 2008 10:28:09 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: <200804301028.09307.scldad@sdc.com.au> I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is the same. Any ideas as to how to handle this? Stephen On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: > * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > > The biggest problem that I have seen with lockfiles on Linux > > At least is, that it seems there is no standard with respect > > To the folder in which they should be created. Also, many > > Distributions seem to set up file system permissions in such > > A way that writing to the lockfile folder is not allowed for > > The normal user -- that's why we stopped using lockfiles > > In our commercial product. > > It seems it depends on the expectations. I consider it as a > feature that by default a linux user cannot access serial ports. > Maybe root connected a modem (can produce phone bills) or even > some serial card reader, maybe with the web servers key pair. > > I would expect that by default a user cannot open the serial port > because of insufficient permissions on the device file. I would > expect this on other unices as well (but I don't know it). > > For windows I think it should be similar but not impacting so > much in practice, because often windows users work with big > permissions on a somewhat high priviledge level or even > Administrator. > > > If we are to still respect lockfiles, we first need to > > Understand where we are expected to look for them. Does > > Anybody have any insight what variants of lockfile folder > > Schema exist out there in the wild? Some apps like minicom > > Seem to even allow users to manually specify a lockfile > > Folder of their choice. > > At least my (ancient) minicom does not allow the user to change > this option, it is displayed but read-only, but root is allowed > to change it. > > > Because of the difficulty finding the right lockfile folder, > > And because of the inherent risk of thinking that something > > Might be locked while it actually isn't, I'd suggest that > > RXTX should have a "soft-off" feature that allows disabling > > ALL Lockfile checks at runtime without recompiling the native > > Sharedlibs. > > sounds very reasonable, yes... > and as admin I would not wish that users could skip such > locking because they do things wrong by default ;) > > (in the end I guess that is related to the dilemma, that > hotplug/user-owned-periphery and multi-user systems simply > conflict) > > > Trent - I like your strategy outline, but I think that it > > Needs to be configurable by the client such that users and/or > > Customer Support can disable lockfiles / disable ioctl in > > Case they detect that they are runing on an OS / Kernal that > > Does not support one or the other. > > Yes, this would be good I guess... Applications could offer > configuration options to control that, maybe similarily as > minicom. > > BTW, man minicom tells: > > *B - Lock file location > On most systems This should be /usr/spool/uucp. > Linux systems use /var/lock. If this directory > does not exist, minicom will not attempt to use > lockfiles. > > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure > and expedient electronic transaction acceptance. Ingenico products leverage > proven technology, established standards and unparalleled ergonomics to > provide optimal reliability, versatility and usability. This comprehensive > range of products is complemented by a global array of services and > partnerships, enabling businesses in a number of vertical sectors to accept > transactions anywhere their business takes them. www.ingenico.com This > message may contain confidential and/or privileged information. If you are > not the addressee or authorized to receive this for the addressee, you must > not use, copy, disclose or take any action based on this message or any > information herein. If you have received this message in error, please > advise the sender immediately by reply e-mail and delete this message. > Thank you for your cooperation. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Wed Apr 30 19:30:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 30 Apr 2008 19:30:51 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804301028.09307.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> <200804301028.09307.scldad@sdc.com.au> Message-ID: Hi Stephen, I suspect ioctl/TIOCEXCL open/O_EXCL would do the job. Mac uses TIOCEXCL and it is POSIX. We use O_EXCL for lockfiles on Linux already. On Wed, 30 Apr 2008, Stephen Davies wrote: > I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is > the same. > > Any ideas as to how to handle this? > > Stephen > > > On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: >> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: >>> The biggest problem that I have seen with lockfiles on Linux >>> At least is, that it seems there is no standard with respect >>> To the folder in which they should be created. Also, many >>> Distributions seem to set up file system permissions in such >>> A way that writing to the lockfile folder is not allowed for >>> The normal user -- that's why we stopped using lockfiles >>> In our commercial product. >> >> It seems it depends on the expectations. I consider it as a >> feature that by default a linux user cannot access serial ports. >> Maybe root connected a modem (can produce phone bills) or even >> some serial card reader, maybe with the web servers key pair. >> >> I would expect that by default a user cannot open the serial port >> because of insufficient permissions on the device file. I would >> expect this on other unices as well (but I don't know it). >> >> For windows I think it should be similar but not impacting so >> much in practice, because often windows users work with big >> permissions on a somewhat high priviledge level or even >> Administrator. >> >>> If we are to still respect lockfiles, we first need to >>> Understand where we are expected to look for them. Does >>> Anybody have any insight what variants of lockfile folder >>> Schema exist out there in the wild? Some apps like minicom >>> Seem to even allow users to manually specify a lockfile >>> Folder of their choice. >> >> At least my (ancient) minicom does not allow the user to change >> this option, it is displayed but read-only, but root is allowed >> to change it. >> >>> Because of the difficulty finding the right lockfile folder, >>> And because of the inherent risk of thinking that something >>> Might be locked while it actually isn't, I'd suggest that >>> RXTX should have a "soft-off" feature that allows disabling >>> ALL Lockfile checks at runtime without recompiling the native >>> Sharedlibs. >> >> sounds very reasonable, yes... >> and as admin I would not wish that users could skip such >> locking because they do things wrong by default ;) >> >> (in the end I guess that is related to the dilemma, that >> hotplug/user-owned-periphery and multi-user systems simply >> conflict) >> >>> Trent - I like your strategy outline, but I think that it >>> Needs to be configurable by the client such that users and/or >>> Customer Support can disable lockfiles / disable ioctl in >>> Case they detect that they are runing on an OS / Kernal that >>> Does not support one or the other. >> >> Yes, this would be good I guess... Applications could offer >> configuration options to control that, maybe similarily as >> minicom. >> >> BTW, man minicom tells: >> >> *B - Lock file location >> On most systems This should be /usr/spool/uucp. >> Linux systems use /var/lock. If this directory >> does not exist, minicom will not attempt to use >> lockfiles. >> >> The statement `Linux systems use /var/lock' is interesting, does >> anyone know the source of this convention? >> >> oki, >> >> Steffen >> >> About Ingenico Throughout the world businesses rely on Ingenico for secure >> and expedient electronic transaction acceptance. Ingenico products leverage >> proven technology, established standards and unparalleled ergonomics to >> provide optimal reliability, versatility and usability. This comprehensive >> range of products is complemented by a global array of services and >> partnerships, enabling businesses in a number of vertical sectors to accept >> transactions anywhere their business takes them. www.ingenico.com This >> message may contain confidential and/or privileged information. If you are >> not the addressee or authorized to receive this for the addressee, you must >> not use, copy, disclose or take any action based on this message or any >> information herein. If you have received this message in error, please >> advise the sender immediately by reply e-mail and delete this message. >> Thank you for your cooperation. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0061.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0059.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0046.html From pboulton at pulsetracer.com Fri Apr 18 14:30:13 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Fri, 18 Apr 2008 13:30:13 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site Message-ID: <480904D5.1060307@pulsetracer.com> Hello, gentle serial porters. I have downloaded the zipped up binaries for use on Windows without Sun's CommAPI, but don't seem able to extract anything from the download. Go to main page, http://www.rxtx.org/ Click on Downloads I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) And I save it to disk. If I try and extract the files with WinZip, Winzip thinks the archive is corrupt. If I try using Windows Explorer, I am able to extract it into a single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than the original .zip. Any help would be much appreciated. Sincerely, Philip Boulton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080418/97d89793/attachment-0044.html From tjarvi at qbang.org Fri Apr 18 19:07:00 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 18 Apr 2008 19:07:00 -0600 (MDT) Subject: [Rxtx] Difficulty opening zip file at rxtx site In-Reply-To: <480904D5.1060307@pulsetracer.com> References: <480904D5.1060307@pulsetracer.com> Message-ID: On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org From pboulton at pulsetracer.com Sat Apr 19 12:46:26 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Sat, 19 Apr 2008 11:46:26 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site References: <480904D5.1060307@pulsetracer.com> Message-ID: <53DB7576450695419E09299104043761A78533@ZTGSERVER.ztg.local> I have been able to get my hands on the binaries, by going to the ftp directory /pub/rxtx at ftp.qbang.org,, and ftping the file rxtx-2.1-7-bins-r2.zip . This opens happily with Winzip, and extracts as the set of files that you describe below. I only experience the ill-formed archive problem by clicking the link on the rxtx.org Downloads page (http://rxtx.qbang.org/pub/rxtx/ rxtx-2.1-7-bins-r2.zip ). Not sure what to make of that. Philip Boulton ________________________________ From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Fri 4/18/2008 6:07 PM To: Philip Boulton Cc: rxtx at qbang.org Subject: Re: [Rxtx] Difficulty opening zip file at rxtx site On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080419/147923bb/attachment-0043.html From jlar310 at gmail.com Sat Apr 19 19:11:55 2008 From: jlar310 at gmail.com (Jeff Larsen) Date: Sat, 19 Apr 2008 20:11:55 -0500 Subject: [Rxtx] Moxa serial over Ethernet driver Message-ID: Hi all, I've been using javax.comm for years to communicate with a legacy radio data system. We want to migrate the java side of the system to a VMware Server virtual machine. We've had great success using Moxa DE-303 and 5610 serial over Ethernet appliances and virtual machines for running hylafax. The OS (Linux in this case) uses a kernel driver to communicate with the Moxa via a virtual serial port such as /dev/ttyr00. I want to do the same thing with javax.comm or gnu.io to connect to a virtual serial port. However I'm hitting road blocks everywhere. javax.comm for Linux sees the virtual port, but there are transmission errors. Tried Solaris too, but the Solaris Moxa drivers don't play nice with javax.comm because the driver uses /dev/pts/n instead of /dev/term/x. Next I tried RXTX on Linux, but I'm getting NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX on Solaris. Has anyone used RXTX with serial over Ethernet devices? Any hints on how to make it work? I know that I'm not completely off track because javax.comm does work with Moxa on a Windows platform, but that's just not an option for production deployment. -- Jeff From tjarvi at qbang.org Sat Apr 19 21:08:41 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 19 Apr 2008 21:08:41 -0600 (MDT) Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: yOn Sat, 19 Apr 2008, Jeff Larsen wrote: > Hi all, > > I've been using javax.comm for years to communicate with a legacy > radio data system. We want to migrate the java side of the system to a > VMware Server virtual machine. We've had great success using Moxa > DE-303 and 5610 serial over Ethernet appliances and virtual machines > for running hylafax. The OS (Linux in this case) uses a kernel driver > to communicate with the Moxa via a virtual serial port such as > /dev/ttyr00. > > I want to do the same thing with javax.comm or gnu.io to connect to a > virtual serial port. However I'm hitting road blocks everywhere. > javax.comm for Linux sees the virtual port, but there are transmission > errors. Tried Solaris too, but the Solaris Moxa drivers don't play > nice with javax.comm because the driver uses /dev/pts/n instead of > /dev/term/x. Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris. > > Has anyone used RXTX with serial over Ethernet devices? Any hints on > how to make it work? > > I know that I'm not completely off track because javax.comm does work > with Moxa on a Windows platform, but that's just not an option for > production deployment. > > Moxa should work under linux. There may be minor issues depending upon how complete the kernel driver is but I think it will work. One of the minor issues is /dev/ttyr00 is not enumerated. There are several work arounds documented with the source code and on the wiki. The easiest solution for testing purposes is to make a symbolic link from /dev/ttyr00 to a port that is enumerated such as /dev/ttyS129. You can later alter the rxtx source or use properties to change the enumerated ports. -- Trent Jarvi tjarvi at qbang.org From d.tonhofer at m-plify.com Sun Apr 20 03:33:30 2008 From: d.tonhofer at m-plify.com (David Tonhofer (M-PLIFY S.A.)) Date: Sun, 20 Apr 2008 11:33:30 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: <480B0DEA.5010908@m-plify.com> Jeff Larsen wrote: > Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris It might be that the Java side of RXTX does not recognize that portname. Trying modifying src/RXTXCommDriver.java as described in this case: http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card From ajmas at sympatico.ca Sun Apr 20 16:37:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Apr 2008 18:37:59 -0400 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <480B0DEA.5010908@m-plify.com> References: <480B0DEA.5010908@m-plify.com> Message-ID: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > Jeff Larsen wrote: >> Next I tried RXTX on Linux, but I'm getting >> NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX >> on Solaris > It might be that the Java side of RXTX does not recognize that > portname. > Trying modifying src/RXTXCommDriver.java as described in this case: > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card I wonder whether it would be worth allowing custom port prefixes as a system parameter? For example: gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" Andre From Martin.Oberhuber at windriver.com Tue Apr 22 12:34:36 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 22 Apr 2008 20:34:36 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> References: <480B0DEA.5010908@m-plify.com> <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE6485848056CD6CE@ism-mail03.corp.ad.wrs.com> Sounds like a great idea... I'm wondering how the "variable part" after the Prefixes could be specified though? What about allowing Regular Expression character Classes in the existing System Property for specifying ports: System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyS[0-9],ttyS[ABC],ttyUSB[0-9a-z]"); The set of allowed patterns would of course need to Be restricted compared to REGEX, because it must be A syntax that supports iterating over it. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Montag, 21. April 2008 00:38 > To: rxtx at qbang.org and Users > Subject: Re: [Rxtx] Moxa serial over Ethernet driver > > > On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > > Jeff Larsen wrote: > >> Next I tried RXTX on Linux, but I'm getting > >> NoSuchPortException connecting to /dev/ttyr00. I have yet > to try RXTX > >> on Solaris > > It might be that the Java side of RXTX does not recognize that > > portname. > > Trying modifying src/RXTXCommDriver.java as described in this case: > > > > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_ > SST-4P.2FLP_multiport_card > > I wonder whether it would be worth allowing custom port > prefixes as a > system parameter? For > example: > > gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Loi.TRAN at weatherford.com Tue Apr 22 13:10:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Tue, 22 Apr 2008 14:10:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled Message-ID: Hi, I'm currently using the Java RXTX API to interface to a serial port. The serial port is connected to a bridge board that communicates with our communications system running at 1.875 Mbps which is linked to an embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no flow control). I send a command to the embedded board through the serial-bridge board which then is relayed to the embedded board. The command sent asks the embedded board to dump a binary image. Here's where I'm hitting some problems. I've successfully done this is an integrated serial port from the laptop. The binary file that comes back is consistent on every attempt. When I use the application I've written to do the same thing with a USB-to-serial adapter, the image I get back is not the same as the image I receive through the USB-to-serial adapter is not consistent at all. A final thing is that when I use a terminal program to dump the binary image with the USB-serial adapter, the image is correct. Every time! What is the terminal program doing that's not being done in my application? My application is quite simple. Has anyone observed this behavior before? If you have, I'd like to know how you've gotten around this problem. Thanks, LT =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From tjarvi at qbang.org Tue Apr 22 21:11:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 22 Apr 2008 21:11:10 -0600 (MDT) Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org From Loi.TRAN at weatherford.com Wed Apr 23 08:35:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Wed, 23 Apr 2008 09:35:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: Thanks for all the responses. I finally tried something that worked consistently. I updated my Prolific driver and repeated my tests. It worked. If you're using the Prolific type USB-serial adapters, do no use the Prolific version 2.0.2.1 driver on Windows. Update it to the latest 2.0.2.8 version. Again, thanks for all the responses. LT -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Tuesday, April 22, 2008 10:11 PM To: TRAN, Loi X. Cc: rxtx at qbang.org Subject: Re: [Rxtx] Prolific USB - RXTX data mangled On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From Martin.Oberhuber at windriver.com Wed Apr 23 18:54:26 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 02:54:26 +0200 Subject: [Rxtx] RXTX port locking on Linux status? Message-ID: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Dear RXTX community, I'm wondering what the status is with RXTX locking serial ports on Linux? My understanding is that the mechanism used in 2.1-7r2 (lockfiles) is not really state of the art, and has lots of problems (e.g. missing permissions). There was an idea to migrate towards a Kernel syscall based solution for port locking. What's the status here? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/9878db9f/attachment-0039.html From tjarvi at qbang.org Wed Apr 23 20:32:24 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Apr 2008 20:32:24 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > Dear RXTX community, > > I'm wondering what the status is with RXTX locking > serial ports on Linux? > > My understanding is that the mechanism used in > 2.1-7r2 (lockfiles) is not really state of the art, and > has lots of problems (e.g. missing permissions). > > There was an idea to migrate towards a Kernel > syscall based solution for port locking. > > What's the status here? > Hi Martin, I'm in favor of deprecating the current FHS locking mechanism in favor of an IOCTL when available. I think it will be available on all the platforms but do not know for sure. The status is unchanged. I've had very few free cycles for such things. Feel free to take a stab at it if you have some time. I believe the IOCTL is used in the Mac OS X code already. I don't see any real backwards compatability issues and the IOCTL should just work. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Apr 24 06:14:06 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 14:14:06 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Thanks Trent. Problem is only that I'm really not at all Familiar with the C part of RXTX. If there Were anything I could do in Java for this, It would be easier for me.... ... Are there any C experts here on the list Who'd like to look at ioctl port locking For linux? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Donnerstag, 24. April 2008 04:32 > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > I'm wondering what the status is with RXTX locking > > serial ports on Linux? > > > > My understanding is that the mechanism used in > > 2.1-7r2 (lockfiles) is not really state of the art, and > > has lots of problems (e.g. missing permissions). > > > > There was an idea to migrate towards a Kernel > > syscall based solution for port locking. > > > > What's the status here? > > > > Hi Martin, > > I'm in favor of deprecating the current FHS locking mechanism > in favor of > an IOCTL when available. I think it will be available on all the > platforms but do not know for sure. > > The status is unchanged. I've had very few free cycles for > such things. > Feel free to take a stab at it if you have some time. I > believe the IOCTL > is used in the Mac OS X code already. > > I don't see any real backwards compatability issues and the > IOCTL should > just work. > > -- > Trent Jarvi > tjarvi at qbang.org > From sspies at sloc.de Thu Apr 24 07:15:36 2008 From: sspies at sloc.de (Sebastian Spies) Date: Thu, 24 Apr 2008 15:15:36 +0200 (CEST) Subject: [Rxtx] rxtx on gumstix: Interrupted system call In-Reply-To: <47FB7B20.7080504@sloc.de> References: <47FB7B20.7080504@sloc.de> Message-ID: <55445.130.83.139.205.1209042936.squirrel@ssl.sloc.de> Dear list, while porting rxtx to the gumstix, I found out, that select used in readArray in SerialImp.c might not work as expected. Maybe, because of missing TIOCSERGETLSR-support? select is often interrupted, so i wrote the following quick'n'dirty hack to make it work on gumstix: diff -Nur rxtx-2.1-7r2/src/SerialImp.c rxtx-2.1-7r2/src/SerialImp.c --- rxtx-2.1-7r2/src/SerialImp.c 2006-01-29 23:19:04.000000000 +0100 +++ rxtx-2.1-7r2-patched/src/SerialImp.c 2008-04-24 14:30:17.000000000 +0200 @@ -3380,7 +3381,7 @@ JNIEXPORT jint JNICALL RXTXPort(readArray)( JNIEnv *env, jobject jobj, jbyteArray jbarray, jint offset, jint length ) { - int bytes; + int bytes = 0; jbyte *body; /* char msg[80]; */ int fd = get_java_var( env, jobj, "fd", "I" ); @@ -3397,9 +3398,18 @@ "readArray", "Invalid length" ); return -1; } - body = (*env)->GetByteArrayElements( env, jbarray, 0 ); - bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ - (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + while(1 > bytes) + { + body = (*env)->GetByteArrayElements( env, jbarray, 0 ); + bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ + (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + // quick'n'dirty - SSP + report (" trying again... \n"); + errno = 0; + } + if( bytes < 0 ) { report( "RXTXPort:readArray bytes < 0" ); LEAVE( "RXTXPort:readArray" ); > Hey, > > I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use > RXTXPort$SerialInputStream.read(), then I get the following Exception. I > did not yet figure out which system call is interrupted as strace > produces loads of output. > > Any help would be very appreciated. Thanks in advance. > Sebastian > > > [java] java.io.IOException: Interrupted system call in readArray > [java] at gnu.io.RXTXPort.readArray(Native Method) > [java] at > gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) > [java] at > java.io.FilterInputStream.read(FilterInputStream.java:189) > [java] at > java.io.BufferedInputStream.refill(BufferedInputStream.java:371) > [java] at > java.io.BufferedInputStream.read(BufferedInputStream.java:229) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) > [java] at > com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) > > -- > Sebastian Spies > > mail: sspies at sloc.de > > > > From fire_baptized at hotmail.com Thu Apr 24 18:27:48 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Thu, 24 Apr 2008 20:27:48 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hello I am having a problem with the serial device connecting (software wise) to the serial port. However I have a test program and it seems to work just fine in that environment - and it doesnt use GUI. The error I am getting is : PortNotFoundException Now the way I have it setup in the GUI environment is that once the user pushes a JButton the program connects using this class: protected void establishConnection() { try { portId = CommPortIdentifier.getPortIdentifier("COM3"); System.out.println("Establishing connction....."); messages[0] = "\nEstablishing connction.....\n"; } catch ( NoSuchPortException noport) { System.out.println("Port not found: "+ noport); messages[0] = "Port not found: "+ noport+"\n"; } try { serialPort = (SerialPort) portId.open("serial", 50); System.out.println("Port has been found."); messages[1] = "Port has been found.\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[1] = "" +usedport; } try { serialPort = (SerialPort) portId.open("serial", 50); messages[2] = "Connecting to COM3 on port 50....\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; } try { serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); System.out.println("Esablishing the transfer rate settings for COM3."); messages[3] = "Esablishing the transfer rate settings for COM3.\n"; } catch (UnsupportedCommOperationException nosupcom) { System.out.println(nosupcom); System.out.println("The tranfer rate could not be esblished on COM3."); messages[3] = "The tranfer rate could not be esblished on COM3.\n"; } System.out.println(serialPort.getFlowControlMode()); messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; //sendDataOut(buffer[3],buffer[4]); } I need all the data in this method (and all the string values in this method) to be printed out on a JTextArea. I wont do me any good if not all the text is printed on a JTextArea in another class. So I have the text printing the JTextArea correctly, but everytime the JButton is activated - it gives me that error message. I did add a disconnect button that is supposed to call the serialPort.close(). _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/273fd4ec/attachment-0038.html From tjarvi at qbang.org Thu Apr 24 21:54:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Apr 2008 21:54:10 -0600 (MDT) Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > Hello I am having a problem with the serial device connecting (software > wise) to the serial port. However I have a test program and it seems to > work just fine in that environment - and it doesnt use GUI. The error I > am getting is : PortNotFoundException Now the way I have it setup in the > GUI environment is that once the user pushes a JButton the program > connects using this class: > > protected void establishConnection() { > try { > portId = CommPortIdentifier.getPortIdentifier("COM3"); > System.out.println("Establishing connction....."); > messages[0] = "\nEstablishing connction.....\n"; > } > catch ( NoSuchPortException noport) { > System.out.println("Port not found: "+ noport); > messages[0] = "Port not found: "+ noport+"\n"; > } > try { > serialPort = (SerialPort) portId.open("serial", 50); > System.out.println("Port has been found."); > messages[1] = "Port has been found.\n"; > } > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[1] = "" +usedport; > } ================================================================= > try { > serialPort = (SerialPort) portId.open("serial", 50); > messages[2] = "Connecting to COM3 on port 50....\n"; > } ================================================================== > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > } > try { > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > System.out.println("Esablishing the transfer rate settings for COM3."); > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > } > catch (UnsupportedCommOperationException nosupcom) { > System.out.println(nosupcom); > System.out.println("The tranfer rate could not be esblished on COM3."); > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > } > System.out.println(serialPort.getFlowControlMode()); > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > //sendDataOut(buffer[3],buffer[4]); > } > > I need all the data in this method (and all the string values in this > method) to be printed out on a JTextArea. I wont do me any good if not > all the text is printed on a JTextArea in another class. So I have the > text printing the JTextArea correctly, but everytime the JButton is > activated - it gives me that error message. I did add a disconnect > button that is supposed to call the serialPort.close(). > The open code used twice is going to throw an exception. It may be that you catch the exception above this code and print a confusing message? A common mistake is people will accidently run two copies of their program. The first instance of the program will open the port and prevent enumeration (finding the port) in the second instance of the program. As an example, you may be running your text based application which is preventing the GUI from seeing the port. Enumeration is done by trying to open the port. If the port is open, Enumeration fails. -- Trent Jarvi tjarvi at qbang.org From fire_baptized at hotmail.com Thu Apr 24 22:32:05 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 00:32:05 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Wow - thanks dude what a dumb thing for me to not catch..... now here is the current problem - right now I am trying to output data again one is with the test program - and it seems that serialPort.setRTS(true); is throwing an exceptions there - now if I show this code please bare in mind that I am only testing - the code is kinda sloppy in my mind - but if I can figure out why calling this function is throwing an exception then maybe I can figure out why my GUI application is getting the same null pointer exceptions when try to send out the data stream. FYI Trent this email is not directed towards you - anyone can jump in on this public static void main(String args[]) { byte[] b = new byte[64]; int keyinput = 0 ; byte x = 0; byte y = 0; PortTesting1 testports = new PortTesting1(); try { joyskoro = Joystick.createInstance(); } catch (IOException ioexc) { System.out.println("There is an input/output problem: " + ioexc); } while (true) { joyskoro.poll(); b[0] = ((byte) -(10 * joyskoro.getY())); b[1] = ((byte) (10 * joyskoro.getX())); System.out.println("The 3rd byte is: " +b[0]); System.out.println("The 4rd byte is: " +b[1]); serialPort.setRTS(true); // HERE IS WHERE THE PROBLEM IS !!!!!!! ON THIS LINE but if I dont have it active in my program the Bluetooth device (that is System.out.println("Ready to send :-) !"); //connected to the serial port does not send out data!!!!! if (joyskoro.isButtonDown(joyskoro.BUTTON10)) { System.out.println("Connection terminated."); serialPort.close(); break; } if (joyskoro.isButtonDown(joyskoro.BUTTON2)) { boolean flag = true; //reading from key input from the keyboard System.out.println("Please input a command: "); while (flag) { try { keyinput = System.in.read(); } catch (IOException ioexc) {/*there is no need to put * anything here */ } if((char)keyinput=='w') { pushIt((byte)85); } if((char)keyinput=='s') { pushIt((byte)84); } if((char)keyinput=='a') { pushIt((byte)83); } if((char)keyinput=='d') { pushIt((byte)82); } if((char)keyinput=='q') { pushIt((byte)89); } if((char)keyinput=='\t') { //this stop reading input from the keyboard flag = false; } } and help anyways here is the block of code that throwing an exception for the test program: > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/5c8f7d68/attachment-0038.html From fire_baptized at hotmail.com Fri Apr 25 07:59:53 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 09:59:53 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Are there any examples of how to push out data? As in using input and output streams - if I can compare code maybe I can see where this is causing a problem. I have a byte array that I am pushing out data. I keep getting null pointer exceptions every where I turn. > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/22228ab6/attachment-0037.html From ajmas at sympatico.ca Sat Apr 26 07:37:09 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 26 Apr 2008 09:37:09 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hi, On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote: > > Are there any examples of how to push out data? As in using input > and output streams - if I can compare code maybe I can see where > this is causing a problem. I have a byte array that I am pushing > out data. I keep getting null pointer exceptions every where I turn. > There are some examples here that might be of help: http://rxtx.qbang.org/wiki/index.php/Examples Andre From fire_baptized at hotmail.com Sat Apr 26 20:13:54 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Sat, 26 Apr 2008 22:13:54 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: looked at those....yep didnt help - I need to push out data with GUI and not get a null pointer exception everytime I try. > CC: rxtx at qbang.org> From: ajmas at sympatico.ca> To: fire_baptized at hotmail.com> Subject: Re: [Rxtx] Serial Problems with Gui.....> Date: Sat, 26 Apr 2008 09:37:09 -0400> > Hi,> > > On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote:> >> > Are there any examples of how to push out data? As in using input > > and output streams - if I can compare code maybe I can see where > > this is causing a problem. I have a byte array that I am pushing > > out data. I keep getting null pointer exceptions every where I turn.> >> > There are some examples here that might be of help:> > http://rxtx.qbang.org/wiki/index.php/Examples> > Andre _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080426/09f95b41/attachment-0036.html From michael.erskine at ketech.com Mon Apr 28 02:47:22 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 28 Apr 2008 09:47:22 +0100 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D426EF3CBBC5@no-sv-03.ketech.local> Jesrael D. Summerhill wrote: > looked at those....yep didnt help - I need to push out data with GUI and > not get a null pointer exception everytime I try. So it seems pretty obvious that your code needs to check for nulls wherever one may occur and report what's happening. Alternatively, catch the npe and display the stack trace. Then you can fix your code so it doesn't try to work with something that ain't there. Regards, Michael Erskine. From scldad at sdc.com.au Mon Apr 28 03:58:34 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Mon, 28 Apr 2008 19:28:34 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Message-ID: <200804281928.34454.scldad@sdc.com.au> Has anybody done any design work on this? The first thing that springs to mind is that we still need to check for lock files because other apps tend to use that approach even if we go to ioctl. Cheers, Stephen Davies On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > Thanks Trent. > > Problem is only that I'm really not at all > Familiar with the C part of RXTX. If there > Were anything I could do in Java for this, > It would be easier for me.... > > ... Are there any C experts here on the list > Who'd like to look at ioctl port locking > For linux? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > -----Original Message----- > > From: Trent Jarvi [mailto:tjarvi at qbang.org] > > Sent: Donnerstag, 24. April 2008 04:32 > > To: Oberhuber, Martin > > Cc: rxtx at qbang.org > > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > > > I'm wondering what the status is with RXTX locking > > > serial ports on Linux? > > > > > > My understanding is that the mechanism used in > > > 2.1-7r2 (lockfiles) is not really state of the art, and > > > has lots of problems (e.g. missing permissions). > > > > > > There was an idea to migrate towards a Kernel > > > syscall based solution for port locking. > > > > > > What's the status here? > > > > Hi Martin, > > > > I'm in favor of deprecating the current FHS locking mechanism > > in favor of > > an IOCTL when available. I think it will be available on all the > > platforms but do not know for sure. > > > > The status is unchanged. I've had very few free cycles for > > such things. > > Feel free to take a stab at it if you have some time. I > > believe the IOCTL > > is used in the Mac OS X code already. > > > > I don't see any real backwards compatability issues and the > > IOCTL should > > just work. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Mon Apr 28 04:21:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 28 Apr 2008 04:21:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804281928.34454.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: I don't think there would need to be any architectural changes. A couple ifdefs and minor changes in the current code should be enough. Proposal: FHS/UUCP locks: continue to respect them, try to create them but do not error if the IOCTL is supported. (But does the IOCTL being defined mean it will work?) Enumeration: Do not assert the IOCTL while opening. Serial.open: assert the IOCTL after open. Continue to use locks as described above after asserting the IOCTL. If the IOCTL is defined but not working, handle it here. Failure cases include the IOCTL is not supported and the port is already locked. On Mon, 28 Apr 2008, Stephen Davies wrote: > Has anybody done any design work on this? > The first thing that springs to mind is that we still need to check for lock > files because other apps tend to use that approach even if we go to ioctl. > > Cheers, > Stephen Davies > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: >> Thanks Trent. >> >> Problem is only that I'm really not at all >> Familiar with the C part of RXTX. If there >> Were anything I could do in Java for this, >> It would be easier for me.... >> >> ... Are there any C experts here on the list >> Who'd like to look at ioctl port locking >> For linux? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >>> -----Original Message----- >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] >>> Sent: Donnerstag, 24. April 2008 04:32 >>> To: Oberhuber, Martin >>> Cc: rxtx at qbang.org >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? >>> >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: >>>> Dear RXTX community, >>>> >>>> I'm wondering what the status is with RXTX locking >>>> serial ports on Linux? >>>> >>>> My understanding is that the mechanism used in >>>> 2.1-7r2 (lockfiles) is not really state of the art, and >>>> has lots of problems (e.g. missing permissions). >>>> >>>> There was an idea to migrate towards a Kernel >>>> syscall based solution for port locking. >>>> >>>> What's the status here? >>> >>> Hi Martin, >>> >>> I'm in favor of deprecating the current FHS locking mechanism >>> in favor of >>> an IOCTL when available. I think it will be available on all the >>> platforms but do not know for sure. >>> >>> The status is unchanged. I've had very few free cycles for >>> such things. >>> Feel free to take a stab at it if you have some time. I >>> believe the IOCTL >>> is used in the Mac OS X code already. >>> >>> I don't see any real backwards compatability issues and the >>> IOCTL should >>> just work. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Tue Apr 29 12:04:04 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Apr 2008 20:04:04 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Hi all, The biggest problem that I have seen with lockfiles on Linux At least is, that it seems there is no standard with respect To the folder in which they should be created. Also, many Distributions seem to set up file system permissions in such A way that writing to the lockfile folder is not allowed for The normal user -- that's why we stopped using lockfiles In our commercial product. If we are to still respect lockfiles, we first need to Understand where we are expected to look for them. Does Anybody have any insight what variants of lockfile folder Schema exist out there in the wild? Some apps like minicom Seem to even allow users to manually specify a lockfile Folder of their choice. Because of the difficulty finding the right lockfile folder, And because of the inherent risk of thinking that something Might be locked while it actually isn't, I'd suggest that RXTX should have a "soft-off" feature that allows disabling ALL Lockfile checks at runtime without recompiling the native Sharedlibs. Trent - I like your strategy outline, but I think that it Needs to be configurable by the client such that users and/or Customer Support can disable lockfiles / disable ioctl in Case they detect that they are runing on an OS / Kernal that Does not support one or the other. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Montag, 28. April 2008 12:22 > To: Stephen Davies > Cc: rxtx at qbang.org; Oberhuber, Martin; Trent Jarvi > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > I don't think there would need to be any architectural > changes. A couple > ifdefs and minor changes in the current code should be enough. > > Proposal: > > FHS/UUCP locks: > continue to respect them, try to create them but do not error if > the IOCTL is supported. (But does the IOCTL being defined mean > it will work?) > Enumeration: > Do not assert the IOCTL while opening. > Serial.open: > assert the IOCTL after open. Continue to use locks as described > above after asserting the IOCTL. If the IOCTL is defined but > not working, handle it here. Failure cases include the IOCTL > is not supported and the port is already locked. > > On Mon, 28 Apr 2008, Stephen Davies wrote: > > > Has anybody done any design work on this? > > The first thing that springs to mind is that we still need > to check for lock > > files because other apps tend to use that approach even if > we go to ioctl. > > > > Cheers, > > Stephen Davies > > > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > >> Thanks Trent. > >> > >> Problem is only that I'm really not at all > >> Familiar with the C part of RXTX. If there > >> Were anything I could do in Java for this, > >> It would be easier for me.... > >> > >> ... Are there any C experts here on the list > >> Who'd like to look at ioctl port locking > >> For linux? > >> > >> Thanks, > >> -- > >> Martin Oberhuber, Senior Member of Technical Staff, Wind River > >> Target Management Project Lead, DSDP PMC Member > >> http://www.eclipse.org/dsdp/tm > >> > >>> -----Original Message----- > >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] > >>> Sent: Donnerstag, 24. April 2008 04:32 > >>> To: Oberhuber, Martin > >>> Cc: rxtx at qbang.org > >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? > >>> > >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > >>>> Dear RXTX community, > >>>> > >>>> I'm wondering what the status is with RXTX locking > >>>> serial ports on Linux? > >>>> > >>>> My understanding is that the mechanism used in > >>>> 2.1-7r2 (lockfiles) is not really state of the art, and > >>>> has lots of problems (e.g. missing permissions). > >>>> > >>>> There was an idea to migrate towards a Kernel > >>>> syscall based solution for port locking. > >>>> > >>>> What's the status here? > >>> > >>> Hi Martin, > >>> > >>> I'm in favor of deprecating the current FHS locking mechanism > >>> in favor of > >>> an IOCTL when available. I think it will be available on all the > >>> platforms but do not know for sure. > >>> > >>> The status is unchanged. I've had very few free cycles for > >>> such things. > >>> Feel free to take a stab at it if you have some time. I > >>> believe the IOCTL > >>> is used in the Mac OS X code already. > >>> > >>> I don't see any real backwards compatability issues and the > >>> IOCTL should > >>> just work. > >>> > >>> -- > >>> Trent Jarvi > >>> tjarvi at qbang.org > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > From Steffen.DETTMER at ingenico.com Tue Apr 29 13:34:44 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 29 Apr 2008 21:34:44 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Message-ID: <20080429193444.GU2928@elberon.bln.de.ingenico.com> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > The biggest problem that I have seen with lockfiles on Linux > At least is, that it seems there is no standard with respect > To the folder in which they should be created. Also, many > Distributions seem to set up file system permissions in such > A way that writing to the lockfile folder is not allowed for > The normal user -- that's why we stopped using lockfiles > In our commercial product. It seems it depends on the expectations. I consider it as a feature that by default a linux user cannot access serial ports. Maybe root connected a modem (can produce phone bills) or even some serial card reader, maybe with the web servers key pair. I would expect that by default a user cannot open the serial port because of insufficient permissions on the device file. I would expect this on other unices as well (but I don't know it). For windows I think it should be similar but not impacting so much in practice, because often windows users work with big permissions on a somewhat high priviledge level or even Administrator. > If we are to still respect lockfiles, we first need to > Understand where we are expected to look for them. Does > Anybody have any insight what variants of lockfile folder > Schema exist out there in the wild? Some apps like minicom > Seem to even allow users to manually specify a lockfile > Folder of their choice. At least my (ancient) minicom does not allow the user to change this option, it is displayed but read-only, but root is allowed to change it. > Because of the difficulty finding the right lockfile folder, > And because of the inherent risk of thinking that something > Might be locked while it actually isn't, I'd suggest that > RXTX should have a "soft-off" feature that allows disabling > ALL Lockfile checks at runtime without recompiling the native > Sharedlibs. sounds very reasonable, yes... and as admin I would not wish that users could skip such locking because they do things wrong by default ;) (in the end I guess that is related to the dilemma, that hotplug/user-owned-periphery and multi-user systems simply conflict) > Trent - I like your strategy outline, but I think that it > Needs to be configurable by the client such that users and/or > Customer Support can disable lockfiles / disable ioctl in > Case they detect that they are runing on an OS / Kernal that > Does not support one or the other. Yes, this would be good I guess... Applications could offer configuration options to control that, maybe similarily as minicom. BTW, man minicom tells: *B - Lock file location On most systems This should be /usr/spool/uucp. Linux systems use /var/lock. If this directory does not exist, minicom will not attempt to use lockfiles. The statement `Linux systems use /var/lock' is interesting, does anyone know the source of this convention? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Tue Apr 29 16:11:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Apr 2008 16:11:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? These details are outlined in the Filesystem Hierarchy Standard (FHS). http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLOCKLOCKFILES -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Tue Apr 29 18:58:09 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Wed, 30 Apr 2008 10:28:09 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: <200804301028.09307.scldad@sdc.com.au> I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is the same. Any ideas as to how to handle this? Stephen On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: > * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > > The biggest problem that I have seen with lockfiles on Linux > > At least is, that it seems there is no standard with respect > > To the folder in which they should be created. Also, many > > Distributions seem to set up file system permissions in such > > A way that writing to the lockfile folder is not allowed for > > The normal user -- that's why we stopped using lockfiles > > In our commercial product. > > It seems it depends on the expectations. I consider it as a > feature that by default a linux user cannot access serial ports. > Maybe root connected a modem (can produce phone bills) or even > some serial card reader, maybe with the web servers key pair. > > I would expect that by default a user cannot open the serial port > because of insufficient permissions on the device file. I would > expect this on other unices as well (but I don't know it). > > For windows I think it should be similar but not impacting so > much in practice, because often windows users work with big > permissions on a somewhat high priviledge level or even > Administrator. > > > If we are to still respect lockfiles, we first need to > > Understand where we are expected to look for them. Does > > Anybody have any insight what variants of lockfile folder > > Schema exist out there in the wild? Some apps like minicom > > Seem to even allow users to manually specify a lockfile > > Folder of their choice. > > At least my (ancient) minicom does not allow the user to change > this option, it is displayed but read-only, but root is allowed > to change it. > > > Because of the difficulty finding the right lockfile folder, > > And because of the inherent risk of thinking that something > > Might be locked while it actually isn't, I'd suggest that > > RXTX should have a "soft-off" feature that allows disabling > > ALL Lockfile checks at runtime without recompiling the native > > Sharedlibs. > > sounds very reasonable, yes... > and as admin I would not wish that users could skip such > locking because they do things wrong by default ;) > > (in the end I guess that is related to the dilemma, that > hotplug/user-owned-periphery and multi-user systems simply > conflict) > > > Trent - I like your strategy outline, but I think that it > > Needs to be configurable by the client such that users and/or > > Customer Support can disable lockfiles / disable ioctl in > > Case they detect that they are runing on an OS / Kernal that > > Does not support one or the other. > > Yes, this would be good I guess... Applications could offer > configuration options to control that, maybe similarily as > minicom. > > BTW, man minicom tells: > > *B - Lock file location > On most systems This should be /usr/spool/uucp. > Linux systems use /var/lock. If this directory > does not exist, minicom will not attempt to use > lockfiles. > > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure > and expedient electronic transaction acceptance. Ingenico products leverage > proven technology, established standards and unparalleled ergonomics to > provide optimal reliability, versatility and usability. This comprehensive > range of products is complemented by a global array of services and > partnerships, enabling businesses in a number of vertical sectors to accept > transactions anywhere their business takes them. www.ingenico.com This > message may contain confidential and/or privileged information. If you are > not the addressee or authorized to receive this for the addressee, you must > not use, copy, disclose or take any action based on this message or any > information herein. If you have received this message in error, please > advise the sender immediately by reply e-mail and delete this message. > Thank you for your cooperation. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Wed Apr 30 19:30:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 30 Apr 2008 19:30:51 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804301028.09307.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> <200804301028.09307.scldad@sdc.com.au> Message-ID: Hi Stephen, I suspect ioctl/TIOCEXCL open/O_EXCL would do the job. Mac uses TIOCEXCL and it is POSIX. We use O_EXCL for lockfiles on Linux already. On Wed, 30 Apr 2008, Stephen Davies wrote: > I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is > the same. > > Any ideas as to how to handle this? > > Stephen > > > On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: >> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: >>> The biggest problem that I have seen with lockfiles on Linux >>> At least is, that it seems there is no standard with respect >>> To the folder in which they should be created. Also, many >>> Distributions seem to set up file system permissions in such >>> A way that writing to the lockfile folder is not allowed for >>> The normal user -- that's why we stopped using lockfiles >>> In our commercial product. >> >> It seems it depends on the expectations. I consider it as a >> feature that by default a linux user cannot access serial ports. >> Maybe root connected a modem (can produce phone bills) or even >> some serial card reader, maybe with the web servers key pair. >> >> I would expect that by default a user cannot open the serial port >> because of insufficient permissions on the device file. I would >> expect this on other unices as well (but I don't know it). >> >> For windows I think it should be similar but not impacting so >> much in practice, because often windows users work with big >> permissions on a somewhat high priviledge level or even >> Administrator. >> >>> If we are to still respect lockfiles, we first need to >>> Understand where we are expected to look for them. Does >>> Anybody have any insight what variants of lockfile folder >>> Schema exist out there in the wild? Some apps like minicom >>> Seem to even allow users to manually specify a lockfile >>> Folder of their choice. >> >> At least my (ancient) minicom does not allow the user to change >> this option, it is displayed but read-only, but root is allowed >> to change it. >> >>> Because of the difficulty finding the right lockfile folder, >>> And because of the inherent risk of thinking that something >>> Might be locked while it actually isn't, I'd suggest that >>> RXTX should have a "soft-off" feature that allows disabling >>> ALL Lockfile checks at runtime without recompiling the native >>> Sharedlibs. >> >> sounds very reasonable, yes... >> and as admin I would not wish that users could skip such >> locking because they do things wrong by default ;) >> >> (in the end I guess that is related to the dilemma, that >> hotplug/user-owned-periphery and multi-user systems simply >> conflict) >> >>> Trent - I like your strategy outline, but I think that it >>> Needs to be configurable by the client such that users and/or >>> Customer Support can disable lockfiles / disable ioctl in >>> Case they detect that they are runing on an OS / Kernal that >>> Does not support one or the other. >> >> Yes, this would be good I guess... Applications could offer >> configuration options to control that, maybe similarily as >> minicom. >> >> BTW, man minicom tells: >> >> *B - Lock file location >> On most systems This should be /usr/spool/uucp. >> Linux systems use /var/lock. If this directory >> does not exist, minicom will not attempt to use >> lockfiles. >> >> The statement `Linux systems use /var/lock' is interesting, does >> anyone know the source of this convention? >> >> oki, >> >> Steffen >> >> About Ingenico Throughout the world businesses rely on Ingenico for secure >> and expedient electronic transaction acceptance. Ingenico products leverage >> proven technology, established standards and unparalleled ergonomics to >> provide optimal reliability, versatility and usability. This comprehensive >> range of products is complemented by a global array of services and >> partnerships, enabling businesses in a number of vertical sectors to accept >> transactions anywhere their business takes them. www.ingenico.com This >> message may contain confidential and/or privileged information. If you are >> not the addressee or authorized to receive this for the addressee, you must >> not use, copy, disclose or take any action based on this message or any >> information herein. If you have received this message in error, please >> advise the sender immediately by reply e-mail and delete this message. >> Thank you for your cooperation. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0062.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0060.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0047.html From pboulton at pulsetracer.com Fri Apr 18 14:30:13 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Fri, 18 Apr 2008 13:30:13 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site Message-ID: <480904D5.1060307@pulsetracer.com> Hello, gentle serial porters. I have downloaded the zipped up binaries for use on Windows without Sun's CommAPI, but don't seem able to extract anything from the download. Go to main page, http://www.rxtx.org/ Click on Downloads I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) And I save it to disk. If I try and extract the files with WinZip, Winzip thinks the archive is corrupt. If I try using Windows Explorer, I am able to extract it into a single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than the original .zip. Any help would be much appreciated. Sincerely, Philip Boulton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080418/97d89793/attachment-0045.html From tjarvi at qbang.org Fri Apr 18 19:07:00 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 18 Apr 2008 19:07:00 -0600 (MDT) Subject: [Rxtx] Difficulty opening zip file at rxtx site In-Reply-To: <480904D5.1060307@pulsetracer.com> References: <480904D5.1060307@pulsetracer.com> Message-ID: On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org From pboulton at pulsetracer.com Sat Apr 19 12:46:26 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Sat, 19 Apr 2008 11:46:26 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site References: <480904D5.1060307@pulsetracer.com> Message-ID: <53DB7576450695419E09299104043761A78533@ZTGSERVER.ztg.local> I have been able to get my hands on the binaries, by going to the ftp directory /pub/rxtx at ftp.qbang.org,, and ftping the file rxtx-2.1-7-bins-r2.zip . This opens happily with Winzip, and extracts as the set of files that you describe below. I only experience the ill-formed archive problem by clicking the link on the rxtx.org Downloads page (http://rxtx.qbang.org/pub/rxtx/ rxtx-2.1-7-bins-r2.zip ). Not sure what to make of that. Philip Boulton ________________________________ From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Fri 4/18/2008 6:07 PM To: Philip Boulton Cc: rxtx at qbang.org Subject: Re: [Rxtx] Difficulty opening zip file at rxtx site On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080419/147923bb/attachment-0044.html From jlar310 at gmail.com Sat Apr 19 19:11:55 2008 From: jlar310 at gmail.com (Jeff Larsen) Date: Sat, 19 Apr 2008 20:11:55 -0500 Subject: [Rxtx] Moxa serial over Ethernet driver Message-ID: Hi all, I've been using javax.comm for years to communicate with a legacy radio data system. We want to migrate the java side of the system to a VMware Server virtual machine. We've had great success using Moxa DE-303 and 5610 serial over Ethernet appliances and virtual machines for running hylafax. The OS (Linux in this case) uses a kernel driver to communicate with the Moxa via a virtual serial port such as /dev/ttyr00. I want to do the same thing with javax.comm or gnu.io to connect to a virtual serial port. However I'm hitting road blocks everywhere. javax.comm for Linux sees the virtual port, but there are transmission errors. Tried Solaris too, but the Solaris Moxa drivers don't play nice with javax.comm because the driver uses /dev/pts/n instead of /dev/term/x. Next I tried RXTX on Linux, but I'm getting NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX on Solaris. Has anyone used RXTX with serial over Ethernet devices? Any hints on how to make it work? I know that I'm not completely off track because javax.comm does work with Moxa on a Windows platform, but that's just not an option for production deployment. -- Jeff From tjarvi at qbang.org Sat Apr 19 21:08:41 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 19 Apr 2008 21:08:41 -0600 (MDT) Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: yOn Sat, 19 Apr 2008, Jeff Larsen wrote: > Hi all, > > I've been using javax.comm for years to communicate with a legacy > radio data system. We want to migrate the java side of the system to a > VMware Server virtual machine. We've had great success using Moxa > DE-303 and 5610 serial over Ethernet appliances and virtual machines > for running hylafax. The OS (Linux in this case) uses a kernel driver > to communicate with the Moxa via a virtual serial port such as > /dev/ttyr00. > > I want to do the same thing with javax.comm or gnu.io to connect to a > virtual serial port. However I'm hitting road blocks everywhere. > javax.comm for Linux sees the virtual port, but there are transmission > errors. Tried Solaris too, but the Solaris Moxa drivers don't play > nice with javax.comm because the driver uses /dev/pts/n instead of > /dev/term/x. Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris. > > Has anyone used RXTX with serial over Ethernet devices? Any hints on > how to make it work? > > I know that I'm not completely off track because javax.comm does work > with Moxa on a Windows platform, but that's just not an option for > production deployment. > > Moxa should work under linux. There may be minor issues depending upon how complete the kernel driver is but I think it will work. One of the minor issues is /dev/ttyr00 is not enumerated. There are several work arounds documented with the source code and on the wiki. The easiest solution for testing purposes is to make a symbolic link from /dev/ttyr00 to a port that is enumerated such as /dev/ttyS129. You can later alter the rxtx source or use properties to change the enumerated ports. -- Trent Jarvi tjarvi at qbang.org From d.tonhofer at m-plify.com Sun Apr 20 03:33:30 2008 From: d.tonhofer at m-plify.com (David Tonhofer (M-PLIFY S.A.)) Date: Sun, 20 Apr 2008 11:33:30 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: <480B0DEA.5010908@m-plify.com> Jeff Larsen wrote: > Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris It might be that the Java side of RXTX does not recognize that portname. Trying modifying src/RXTXCommDriver.java as described in this case: http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card From ajmas at sympatico.ca Sun Apr 20 16:37:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Apr 2008 18:37:59 -0400 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <480B0DEA.5010908@m-plify.com> References: <480B0DEA.5010908@m-plify.com> Message-ID: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > Jeff Larsen wrote: >> Next I tried RXTX on Linux, but I'm getting >> NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX >> on Solaris > It might be that the Java side of RXTX does not recognize that > portname. > Trying modifying src/RXTXCommDriver.java as described in this case: > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card I wonder whether it would be worth allowing custom port prefixes as a system parameter? For example: gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" Andre From Martin.Oberhuber at windriver.com Tue Apr 22 12:34:36 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 22 Apr 2008 20:34:36 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> References: <480B0DEA.5010908@m-plify.com> <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE6485848056CD6CE@ism-mail03.corp.ad.wrs.com> Sounds like a great idea... I'm wondering how the "variable part" after the Prefixes could be specified though? What about allowing Regular Expression character Classes in the existing System Property for specifying ports: System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyS[0-9],ttyS[ABC],ttyUSB[0-9a-z]"); The set of allowed patterns would of course need to Be restricted compared to REGEX, because it must be A syntax that supports iterating over it. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Montag, 21. April 2008 00:38 > To: rxtx at qbang.org and Users > Subject: Re: [Rxtx] Moxa serial over Ethernet driver > > > On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > > Jeff Larsen wrote: > >> Next I tried RXTX on Linux, but I'm getting > >> NoSuchPortException connecting to /dev/ttyr00. I have yet > to try RXTX > >> on Solaris > > It might be that the Java side of RXTX does not recognize that > > portname. > > Trying modifying src/RXTXCommDriver.java as described in this case: > > > > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_ > SST-4P.2FLP_multiport_card > > I wonder whether it would be worth allowing custom port > prefixes as a > system parameter? For > example: > > gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Loi.TRAN at weatherford.com Tue Apr 22 13:10:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Tue, 22 Apr 2008 14:10:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled Message-ID: Hi, I'm currently using the Java RXTX API to interface to a serial port. The serial port is connected to a bridge board that communicates with our communications system running at 1.875 Mbps which is linked to an embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no flow control). I send a command to the embedded board through the serial-bridge board which then is relayed to the embedded board. The command sent asks the embedded board to dump a binary image. Here's where I'm hitting some problems. I've successfully done this is an integrated serial port from the laptop. The binary file that comes back is consistent on every attempt. When I use the application I've written to do the same thing with a USB-to-serial adapter, the image I get back is not the same as the image I receive through the USB-to-serial adapter is not consistent at all. A final thing is that when I use a terminal program to dump the binary image with the USB-serial adapter, the image is correct. Every time! What is the terminal program doing that's not being done in my application? My application is quite simple. Has anyone observed this behavior before? If you have, I'd like to know how you've gotten around this problem. Thanks, LT =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From tjarvi at qbang.org Tue Apr 22 21:11:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 22 Apr 2008 21:11:10 -0600 (MDT) Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org From Loi.TRAN at weatherford.com Wed Apr 23 08:35:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Wed, 23 Apr 2008 09:35:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: Thanks for all the responses. I finally tried something that worked consistently. I updated my Prolific driver and repeated my tests. It worked. If you're using the Prolific type USB-serial adapters, do no use the Prolific version 2.0.2.1 driver on Windows. Update it to the latest 2.0.2.8 version. Again, thanks for all the responses. LT -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Tuesday, April 22, 2008 10:11 PM To: TRAN, Loi X. Cc: rxtx at qbang.org Subject: Re: [Rxtx] Prolific USB - RXTX data mangled On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From Martin.Oberhuber at windriver.com Wed Apr 23 18:54:26 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 02:54:26 +0200 Subject: [Rxtx] RXTX port locking on Linux status? Message-ID: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Dear RXTX community, I'm wondering what the status is with RXTX locking serial ports on Linux? My understanding is that the mechanism used in 2.1-7r2 (lockfiles) is not really state of the art, and has lots of problems (e.g. missing permissions). There was an idea to migrate towards a Kernel syscall based solution for port locking. What's the status here? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/9878db9f/attachment-0040.html From tjarvi at qbang.org Wed Apr 23 20:32:24 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Apr 2008 20:32:24 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > Dear RXTX community, > > I'm wondering what the status is with RXTX locking > serial ports on Linux? > > My understanding is that the mechanism used in > 2.1-7r2 (lockfiles) is not really state of the art, and > has lots of problems (e.g. missing permissions). > > There was an idea to migrate towards a Kernel > syscall based solution for port locking. > > What's the status here? > Hi Martin, I'm in favor of deprecating the current FHS locking mechanism in favor of an IOCTL when available. I think it will be available on all the platforms but do not know for sure. The status is unchanged. I've had very few free cycles for such things. Feel free to take a stab at it if you have some time. I believe the IOCTL is used in the Mac OS X code already. I don't see any real backwards compatability issues and the IOCTL should just work. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Apr 24 06:14:06 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 14:14:06 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Thanks Trent. Problem is only that I'm really not at all Familiar with the C part of RXTX. If there Were anything I could do in Java for this, It would be easier for me.... ... Are there any C experts here on the list Who'd like to look at ioctl port locking For linux? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Donnerstag, 24. April 2008 04:32 > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > I'm wondering what the status is with RXTX locking > > serial ports on Linux? > > > > My understanding is that the mechanism used in > > 2.1-7r2 (lockfiles) is not really state of the art, and > > has lots of problems (e.g. missing permissions). > > > > There was an idea to migrate towards a Kernel > > syscall based solution for port locking. > > > > What's the status here? > > > > Hi Martin, > > I'm in favor of deprecating the current FHS locking mechanism > in favor of > an IOCTL when available. I think it will be available on all the > platforms but do not know for sure. > > The status is unchanged. I've had very few free cycles for > such things. > Feel free to take a stab at it if you have some time. I > believe the IOCTL > is used in the Mac OS X code already. > > I don't see any real backwards compatability issues and the > IOCTL should > just work. > > -- > Trent Jarvi > tjarvi at qbang.org > From sspies at sloc.de Thu Apr 24 07:15:36 2008 From: sspies at sloc.de (Sebastian Spies) Date: Thu, 24 Apr 2008 15:15:36 +0200 (CEST) Subject: [Rxtx] rxtx on gumstix: Interrupted system call In-Reply-To: <47FB7B20.7080504@sloc.de> References: <47FB7B20.7080504@sloc.de> Message-ID: <55445.130.83.139.205.1209042936.squirrel@ssl.sloc.de> Dear list, while porting rxtx to the gumstix, I found out, that select used in readArray in SerialImp.c might not work as expected. Maybe, because of missing TIOCSERGETLSR-support? select is often interrupted, so i wrote the following quick'n'dirty hack to make it work on gumstix: diff -Nur rxtx-2.1-7r2/src/SerialImp.c rxtx-2.1-7r2/src/SerialImp.c --- rxtx-2.1-7r2/src/SerialImp.c 2006-01-29 23:19:04.000000000 +0100 +++ rxtx-2.1-7r2-patched/src/SerialImp.c 2008-04-24 14:30:17.000000000 +0200 @@ -3380,7 +3381,7 @@ JNIEXPORT jint JNICALL RXTXPort(readArray)( JNIEnv *env, jobject jobj, jbyteArray jbarray, jint offset, jint length ) { - int bytes; + int bytes = 0; jbyte *body; /* char msg[80]; */ int fd = get_java_var( env, jobj, "fd", "I" ); @@ -3397,9 +3398,18 @@ "readArray", "Invalid length" ); return -1; } - body = (*env)->GetByteArrayElements( env, jbarray, 0 ); - bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ - (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + while(1 > bytes) + { + body = (*env)->GetByteArrayElements( env, jbarray, 0 ); + bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ + (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + // quick'n'dirty - SSP + report (" trying again... \n"); + errno = 0; + } + if( bytes < 0 ) { report( "RXTXPort:readArray bytes < 0" ); LEAVE( "RXTXPort:readArray" ); > Hey, > > I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use > RXTXPort$SerialInputStream.read(), then I get the following Exception. I > did not yet figure out which system call is interrupted as strace > produces loads of output. > > Any help would be very appreciated. Thanks in advance. > Sebastian > > > [java] java.io.IOException: Interrupted system call in readArray > [java] at gnu.io.RXTXPort.readArray(Native Method) > [java] at > gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) > [java] at > java.io.FilterInputStream.read(FilterInputStream.java:189) > [java] at > java.io.BufferedInputStream.refill(BufferedInputStream.java:371) > [java] at > java.io.BufferedInputStream.read(BufferedInputStream.java:229) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) > [java] at > com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) > > -- > Sebastian Spies > > mail: sspies at sloc.de > > > > From fire_baptized at hotmail.com Thu Apr 24 18:27:48 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Thu, 24 Apr 2008 20:27:48 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hello I am having a problem with the serial device connecting (software wise) to the serial port. However I have a test program and it seems to work just fine in that environment - and it doesnt use GUI. The error I am getting is : PortNotFoundException Now the way I have it setup in the GUI environment is that once the user pushes a JButton the program connects using this class: protected void establishConnection() { try { portId = CommPortIdentifier.getPortIdentifier("COM3"); System.out.println("Establishing connction....."); messages[0] = "\nEstablishing connction.....\n"; } catch ( NoSuchPortException noport) { System.out.println("Port not found: "+ noport); messages[0] = "Port not found: "+ noport+"\n"; } try { serialPort = (SerialPort) portId.open("serial", 50); System.out.println("Port has been found."); messages[1] = "Port has been found.\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[1] = "" +usedport; } try { serialPort = (SerialPort) portId.open("serial", 50); messages[2] = "Connecting to COM3 on port 50....\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; } try { serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); System.out.println("Esablishing the transfer rate settings for COM3."); messages[3] = "Esablishing the transfer rate settings for COM3.\n"; } catch (UnsupportedCommOperationException nosupcom) { System.out.println(nosupcom); System.out.println("The tranfer rate could not be esblished on COM3."); messages[3] = "The tranfer rate could not be esblished on COM3.\n"; } System.out.println(serialPort.getFlowControlMode()); messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; //sendDataOut(buffer[3],buffer[4]); } I need all the data in this method (and all the string values in this method) to be printed out on a JTextArea. I wont do me any good if not all the text is printed on a JTextArea in another class. So I have the text printing the JTextArea correctly, but everytime the JButton is activated - it gives me that error message. I did add a disconnect button that is supposed to call the serialPort.close(). _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/273fd4ec/attachment-0039.html From tjarvi at qbang.org Thu Apr 24 21:54:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Apr 2008 21:54:10 -0600 (MDT) Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > Hello I am having a problem with the serial device connecting (software > wise) to the serial port. However I have a test program and it seems to > work just fine in that environment - and it doesnt use GUI. The error I > am getting is : PortNotFoundException Now the way I have it setup in the > GUI environment is that once the user pushes a JButton the program > connects using this class: > > protected void establishConnection() { > try { > portId = CommPortIdentifier.getPortIdentifier("COM3"); > System.out.println("Establishing connction....."); > messages[0] = "\nEstablishing connction.....\n"; > } > catch ( NoSuchPortException noport) { > System.out.println("Port not found: "+ noport); > messages[0] = "Port not found: "+ noport+"\n"; > } > try { > serialPort = (SerialPort) portId.open("serial", 50); > System.out.println("Port has been found."); > messages[1] = "Port has been found.\n"; > } > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[1] = "" +usedport; > } ================================================================= > try { > serialPort = (SerialPort) portId.open("serial", 50); > messages[2] = "Connecting to COM3 on port 50....\n"; > } ================================================================== > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > } > try { > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > System.out.println("Esablishing the transfer rate settings for COM3."); > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > } > catch (UnsupportedCommOperationException nosupcom) { > System.out.println(nosupcom); > System.out.println("The tranfer rate could not be esblished on COM3."); > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > } > System.out.println(serialPort.getFlowControlMode()); > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > //sendDataOut(buffer[3],buffer[4]); > } > > I need all the data in this method (and all the string values in this > method) to be printed out on a JTextArea. I wont do me any good if not > all the text is printed on a JTextArea in another class. So I have the > text printing the JTextArea correctly, but everytime the JButton is > activated - it gives me that error message. I did add a disconnect > button that is supposed to call the serialPort.close(). > The open code used twice is going to throw an exception. It may be that you catch the exception above this code and print a confusing message? A common mistake is people will accidently run two copies of their program. The first instance of the program will open the port and prevent enumeration (finding the port) in the second instance of the program. As an example, you may be running your text based application which is preventing the GUI from seeing the port. Enumeration is done by trying to open the port. If the port is open, Enumeration fails. -- Trent Jarvi tjarvi at qbang.org From fire_baptized at hotmail.com Thu Apr 24 22:32:05 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 00:32:05 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Wow - thanks dude what a dumb thing for me to not catch..... now here is the current problem - right now I am trying to output data again one is with the test program - and it seems that serialPort.setRTS(true); is throwing an exceptions there - now if I show this code please bare in mind that I am only testing - the code is kinda sloppy in my mind - but if I can figure out why calling this function is throwing an exception then maybe I can figure out why my GUI application is getting the same null pointer exceptions when try to send out the data stream. FYI Trent this email is not directed towards you - anyone can jump in on this public static void main(String args[]) { byte[] b = new byte[64]; int keyinput = 0 ; byte x = 0; byte y = 0; PortTesting1 testports = new PortTesting1(); try { joyskoro = Joystick.createInstance(); } catch (IOException ioexc) { System.out.println("There is an input/output problem: " + ioexc); } while (true) { joyskoro.poll(); b[0] = ((byte) -(10 * joyskoro.getY())); b[1] = ((byte) (10 * joyskoro.getX())); System.out.println("The 3rd byte is: " +b[0]); System.out.println("The 4rd byte is: " +b[1]); serialPort.setRTS(true); // HERE IS WHERE THE PROBLEM IS !!!!!!! ON THIS LINE but if I dont have it active in my program the Bluetooth device (that is System.out.println("Ready to send :-) !"); //connected to the serial port does not send out data!!!!! if (joyskoro.isButtonDown(joyskoro.BUTTON10)) { System.out.println("Connection terminated."); serialPort.close(); break; } if (joyskoro.isButtonDown(joyskoro.BUTTON2)) { boolean flag = true; //reading from key input from the keyboard System.out.println("Please input a command: "); while (flag) { try { keyinput = System.in.read(); } catch (IOException ioexc) {/*there is no need to put * anything here */ } if((char)keyinput=='w') { pushIt((byte)85); } if((char)keyinput=='s') { pushIt((byte)84); } if((char)keyinput=='a') { pushIt((byte)83); } if((char)keyinput=='d') { pushIt((byte)82); } if((char)keyinput=='q') { pushIt((byte)89); } if((char)keyinput=='\t') { //this stop reading input from the keyboard flag = false; } } and help anyways here is the block of code that throwing an exception for the test program: > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/5c8f7d68/attachment-0039.html From fire_baptized at hotmail.com Fri Apr 25 07:59:53 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 09:59:53 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Are there any examples of how to push out data? As in using input and output streams - if I can compare code maybe I can see where this is causing a problem. I have a byte array that I am pushing out data. I keep getting null pointer exceptions every where I turn. > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/22228ab6/attachment-0038.html From ajmas at sympatico.ca Sat Apr 26 07:37:09 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 26 Apr 2008 09:37:09 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hi, On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote: > > Are there any examples of how to push out data? As in using input > and output streams - if I can compare code maybe I can see where > this is causing a problem. I have a byte array that I am pushing > out data. I keep getting null pointer exceptions every where I turn. > There are some examples here that might be of help: http://rxtx.qbang.org/wiki/index.php/Examples Andre From fire_baptized at hotmail.com Sat Apr 26 20:13:54 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Sat, 26 Apr 2008 22:13:54 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: looked at those....yep didnt help - I need to push out data with GUI and not get a null pointer exception everytime I try. > CC: rxtx at qbang.org> From: ajmas at sympatico.ca> To: fire_baptized at hotmail.com> Subject: Re: [Rxtx] Serial Problems with Gui.....> Date: Sat, 26 Apr 2008 09:37:09 -0400> > Hi,> > > On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote:> >> > Are there any examples of how to push out data? As in using input > > and output streams - if I can compare code maybe I can see where > > this is causing a problem. I have a byte array that I am pushing > > out data. I keep getting null pointer exceptions every where I turn.> >> > There are some examples here that might be of help:> > http://rxtx.qbang.org/wiki/index.php/Examples> > Andre _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080426/09f95b41/attachment-0037.html From michael.erskine at ketech.com Mon Apr 28 02:47:22 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 28 Apr 2008 09:47:22 +0100 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D426EF3CBBC5@no-sv-03.ketech.local> Jesrael D. Summerhill wrote: > looked at those....yep didnt help - I need to push out data with GUI and > not get a null pointer exception everytime I try. So it seems pretty obvious that your code needs to check for nulls wherever one may occur and report what's happening. Alternatively, catch the npe and display the stack trace. Then you can fix your code so it doesn't try to work with something that ain't there. Regards, Michael Erskine. From scldad at sdc.com.au Mon Apr 28 03:58:34 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Mon, 28 Apr 2008 19:28:34 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Message-ID: <200804281928.34454.scldad@sdc.com.au> Has anybody done any design work on this? The first thing that springs to mind is that we still need to check for lock files because other apps tend to use that approach even if we go to ioctl. Cheers, Stephen Davies On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > Thanks Trent. > > Problem is only that I'm really not at all > Familiar with the C part of RXTX. If there > Were anything I could do in Java for this, > It would be easier for me.... > > ... Are there any C experts here on the list > Who'd like to look at ioctl port locking > For linux? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > -----Original Message----- > > From: Trent Jarvi [mailto:tjarvi at qbang.org] > > Sent: Donnerstag, 24. April 2008 04:32 > > To: Oberhuber, Martin > > Cc: rxtx at qbang.org > > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > > > I'm wondering what the status is with RXTX locking > > > serial ports on Linux? > > > > > > My understanding is that the mechanism used in > > > 2.1-7r2 (lockfiles) is not really state of the art, and > > > has lots of problems (e.g. missing permissions). > > > > > > There was an idea to migrate towards a Kernel > > > syscall based solution for port locking. > > > > > > What's the status here? > > > > Hi Martin, > > > > I'm in favor of deprecating the current FHS locking mechanism > > in favor of > > an IOCTL when available. I think it will be available on all the > > platforms but do not know for sure. > > > > The status is unchanged. I've had very few free cycles for > > such things. > > Feel free to take a stab at it if you have some time. I > > believe the IOCTL > > is used in the Mac OS X code already. > > > > I don't see any real backwards compatability issues and the > > IOCTL should > > just work. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Mon Apr 28 04:21:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 28 Apr 2008 04:21:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804281928.34454.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: I don't think there would need to be any architectural changes. A couple ifdefs and minor changes in the current code should be enough. Proposal: FHS/UUCP locks: continue to respect them, try to create them but do not error if the IOCTL is supported. (But does the IOCTL being defined mean it will work?) Enumeration: Do not assert the IOCTL while opening. Serial.open: assert the IOCTL after open. Continue to use locks as described above after asserting the IOCTL. If the IOCTL is defined but not working, handle it here. Failure cases include the IOCTL is not supported and the port is already locked. On Mon, 28 Apr 2008, Stephen Davies wrote: > Has anybody done any design work on this? > The first thing that springs to mind is that we still need to check for lock > files because other apps tend to use that approach even if we go to ioctl. > > Cheers, > Stephen Davies > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: >> Thanks Trent. >> >> Problem is only that I'm really not at all >> Familiar with the C part of RXTX. If there >> Were anything I could do in Java for this, >> It would be easier for me.... >> >> ... Are there any C experts here on the list >> Who'd like to look at ioctl port locking >> For linux? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >>> -----Original Message----- >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] >>> Sent: Donnerstag, 24. April 2008 04:32 >>> To: Oberhuber, Martin >>> Cc: rxtx at qbang.org >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? >>> >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: >>>> Dear RXTX community, >>>> >>>> I'm wondering what the status is with RXTX locking >>>> serial ports on Linux? >>>> >>>> My understanding is that the mechanism used in >>>> 2.1-7r2 (lockfiles) is not really state of the art, and >>>> has lots of problems (e.g. missing permissions). >>>> >>>> There was an idea to migrate towards a Kernel >>>> syscall based solution for port locking. >>>> >>>> What's the status here? >>> >>> Hi Martin, >>> >>> I'm in favor of deprecating the current FHS locking mechanism >>> in favor of >>> an IOCTL when available. I think it will be available on all the >>> platforms but do not know for sure. >>> >>> The status is unchanged. I've had very few free cycles for >>> such things. >>> Feel free to take a stab at it if you have some time. I >>> believe the IOCTL >>> is used in the Mac OS X code already. >>> >>> I don't see any real backwards compatability issues and the >>> IOCTL should >>> just work. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Tue Apr 29 12:04:04 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Apr 2008 20:04:04 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Hi all, The biggest problem that I have seen with lockfiles on Linux At least is, that it seems there is no standard with respect To the folder in which they should be created. Also, many Distributions seem to set up file system permissions in such A way that writing to the lockfile folder is not allowed for The normal user -- that's why we stopped using lockfiles In our commercial product. If we are to still respect lockfiles, we first need to Understand where we are expected to look for them. Does Anybody have any insight what variants of lockfile folder Schema exist out there in the wild? Some apps like minicom Seem to even allow users to manually specify a lockfile Folder of their choice. Because of the difficulty finding the right lockfile folder, And because of the inherent risk of thinking that something Might be locked while it actually isn't, I'd suggest that RXTX should have a "soft-off" feature that allows disabling ALL Lockfile checks at runtime without recompiling the native Sharedlibs. Trent - I like your strategy outline, but I think that it Needs to be configurable by the client such that users and/or Customer Support can disable lockfiles / disable ioctl in Case they detect that they are runing on an OS / Kernal that Does not support one or the other. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Montag, 28. April 2008 12:22 > To: Stephen Davies > Cc: rxtx at qbang.org; Oberhuber, Martin; Trent Jarvi > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > I don't think there would need to be any architectural > changes. A couple > ifdefs and minor changes in the current code should be enough. > > Proposal: > > FHS/UUCP locks: > continue to respect them, try to create them but do not error if > the IOCTL is supported. (But does the IOCTL being defined mean > it will work?) > Enumeration: > Do not assert the IOCTL while opening. > Serial.open: > assert the IOCTL after open. Continue to use locks as described > above after asserting the IOCTL. If the IOCTL is defined but > not working, handle it here. Failure cases include the IOCTL > is not supported and the port is already locked. > > On Mon, 28 Apr 2008, Stephen Davies wrote: > > > Has anybody done any design work on this? > > The first thing that springs to mind is that we still need > to check for lock > > files because other apps tend to use that approach even if > we go to ioctl. > > > > Cheers, > > Stephen Davies > > > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > >> Thanks Trent. > >> > >> Problem is only that I'm really not at all > >> Familiar with the C part of RXTX. If there > >> Were anything I could do in Java for this, > >> It would be easier for me.... > >> > >> ... Are there any C experts here on the list > >> Who'd like to look at ioctl port locking > >> For linux? > >> > >> Thanks, > >> -- > >> Martin Oberhuber, Senior Member of Technical Staff, Wind River > >> Target Management Project Lead, DSDP PMC Member > >> http://www.eclipse.org/dsdp/tm > >> > >>> -----Original Message----- > >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] > >>> Sent: Donnerstag, 24. April 2008 04:32 > >>> To: Oberhuber, Martin > >>> Cc: rxtx at qbang.org > >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? > >>> > >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > >>>> Dear RXTX community, > >>>> > >>>> I'm wondering what the status is with RXTX locking > >>>> serial ports on Linux? > >>>> > >>>> My understanding is that the mechanism used in > >>>> 2.1-7r2 (lockfiles) is not really state of the art, and > >>>> has lots of problems (e.g. missing permissions). > >>>> > >>>> There was an idea to migrate towards a Kernel > >>>> syscall based solution for port locking. > >>>> > >>>> What's the status here? > >>> > >>> Hi Martin, > >>> > >>> I'm in favor of deprecating the current FHS locking mechanism > >>> in favor of > >>> an IOCTL when available. I think it will be available on all the > >>> platforms but do not know for sure. > >>> > >>> The status is unchanged. I've had very few free cycles for > >>> such things. > >>> Feel free to take a stab at it if you have some time. I > >>> believe the IOCTL > >>> is used in the Mac OS X code already. > >>> > >>> I don't see any real backwards compatability issues and the > >>> IOCTL should > >>> just work. > >>> > >>> -- > >>> Trent Jarvi > >>> tjarvi at qbang.org > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > From Steffen.DETTMER at ingenico.com Tue Apr 29 13:34:44 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 29 Apr 2008 21:34:44 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Message-ID: <20080429193444.GU2928@elberon.bln.de.ingenico.com> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > The biggest problem that I have seen with lockfiles on Linux > At least is, that it seems there is no standard with respect > To the folder in which they should be created. Also, many > Distributions seem to set up file system permissions in such > A way that writing to the lockfile folder is not allowed for > The normal user -- that's why we stopped using lockfiles > In our commercial product. It seems it depends on the expectations. I consider it as a feature that by default a linux user cannot access serial ports. Maybe root connected a modem (can produce phone bills) or even some serial card reader, maybe with the web servers key pair. I would expect that by default a user cannot open the serial port because of insufficient permissions on the device file. I would expect this on other unices as well (but I don't know it). For windows I think it should be similar but not impacting so much in practice, because often windows users work with big permissions on a somewhat high priviledge level or even Administrator. > If we are to still respect lockfiles, we first need to > Understand where we are expected to look for them. Does > Anybody have any insight what variants of lockfile folder > Schema exist out there in the wild? Some apps like minicom > Seem to even allow users to manually specify a lockfile > Folder of their choice. At least my (ancient) minicom does not allow the user to change this option, it is displayed but read-only, but root is allowed to change it. > Because of the difficulty finding the right lockfile folder, > And because of the inherent risk of thinking that something > Might be locked while it actually isn't, I'd suggest that > RXTX should have a "soft-off" feature that allows disabling > ALL Lockfile checks at runtime without recompiling the native > Sharedlibs. sounds very reasonable, yes... and as admin I would not wish that users could skip such locking because they do things wrong by default ;) (in the end I guess that is related to the dilemma, that hotplug/user-owned-periphery and multi-user systems simply conflict) > Trent - I like your strategy outline, but I think that it > Needs to be configurable by the client such that users and/or > Customer Support can disable lockfiles / disable ioctl in > Case they detect that they are runing on an OS / Kernal that > Does not support one or the other. Yes, this would be good I guess... Applications could offer configuration options to control that, maybe similarily as minicom. BTW, man minicom tells: *B - Lock file location On most systems This should be /usr/spool/uucp. Linux systems use /var/lock. If this directory does not exist, minicom will not attempt to use lockfiles. The statement `Linux systems use /var/lock' is interesting, does anyone know the source of this convention? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Tue Apr 29 16:11:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Apr 2008 16:11:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? These details are outlined in the Filesystem Hierarchy Standard (FHS). http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLOCKLOCKFILES -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Tue Apr 29 18:58:09 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Wed, 30 Apr 2008 10:28:09 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: <200804301028.09307.scldad@sdc.com.au> I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is the same. Any ideas as to how to handle this? Stephen On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: > * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > > The biggest problem that I have seen with lockfiles on Linux > > At least is, that it seems there is no standard with respect > > To the folder in which they should be created. Also, many > > Distributions seem to set up file system permissions in such > > A way that writing to the lockfile folder is not allowed for > > The normal user -- that's why we stopped using lockfiles > > In our commercial product. > > It seems it depends on the expectations. I consider it as a > feature that by default a linux user cannot access serial ports. > Maybe root connected a modem (can produce phone bills) or even > some serial card reader, maybe with the web servers key pair. > > I would expect that by default a user cannot open the serial port > because of insufficient permissions on the device file. I would > expect this on other unices as well (but I don't know it). > > For windows I think it should be similar but not impacting so > much in practice, because often windows users work with big > permissions on a somewhat high priviledge level or even > Administrator. > > > If we are to still respect lockfiles, we first need to > > Understand where we are expected to look for them. Does > > Anybody have any insight what variants of lockfile folder > > Schema exist out there in the wild? Some apps like minicom > > Seem to even allow users to manually specify a lockfile > > Folder of their choice. > > At least my (ancient) minicom does not allow the user to change > this option, it is displayed but read-only, but root is allowed > to change it. > > > Because of the difficulty finding the right lockfile folder, > > And because of the inherent risk of thinking that something > > Might be locked while it actually isn't, I'd suggest that > > RXTX should have a "soft-off" feature that allows disabling > > ALL Lockfile checks at runtime without recompiling the native > > Sharedlibs. > > sounds very reasonable, yes... > and as admin I would not wish that users could skip such > locking because they do things wrong by default ;) > > (in the end I guess that is related to the dilemma, that > hotplug/user-owned-periphery and multi-user systems simply > conflict) > > > Trent - I like your strategy outline, but I think that it > > Needs to be configurable by the client such that users and/or > > Customer Support can disable lockfiles / disable ioctl in > > Case they detect that they are runing on an OS / Kernal that > > Does not support one or the other. > > Yes, this would be good I guess... Applications could offer > configuration options to control that, maybe similarily as > minicom. > > BTW, man minicom tells: > > *B - Lock file location > On most systems This should be /usr/spool/uucp. > Linux systems use /var/lock. If this directory > does not exist, minicom will not attempt to use > lockfiles. > > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure > and expedient electronic transaction acceptance. Ingenico products leverage > proven technology, established standards and unparalleled ergonomics to > provide optimal reliability, versatility and usability. This comprehensive > range of products is complemented by a global array of services and > partnerships, enabling businesses in a number of vertical sectors to accept > transactions anywhere their business takes them. www.ingenico.com This > message may contain confidential and/or privileged information. If you are > not the addressee or authorized to receive this for the addressee, you must > not use, copy, disclose or take any action based on this message or any > information herein. If you have received this message in error, please > advise the sender immediately by reply e-mail and delete this message. > Thank you for your cooperation. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Wed Apr 30 19:30:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 30 Apr 2008 19:30:51 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804301028.09307.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> <200804301028.09307.scldad@sdc.com.au> Message-ID: Hi Stephen, I suspect ioctl/TIOCEXCL open/O_EXCL would do the job. Mac uses TIOCEXCL and it is POSIX. We use O_EXCL for lockfiles on Linux already. On Wed, 30 Apr 2008, Stephen Davies wrote: > I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is > the same. > > Any ideas as to how to handle this? > > Stephen > > > On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: >> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: >>> The biggest problem that I have seen with lockfiles on Linux >>> At least is, that it seems there is no standard with respect >>> To the folder in which they should be created. Also, many >>> Distributions seem to set up file system permissions in such >>> A way that writing to the lockfile folder is not allowed for >>> The normal user -- that's why we stopped using lockfiles >>> In our commercial product. >> >> It seems it depends on the expectations. I consider it as a >> feature that by default a linux user cannot access serial ports. >> Maybe root connected a modem (can produce phone bills) or even >> some serial card reader, maybe with the web servers key pair. >> >> I would expect that by default a user cannot open the serial port >> because of insufficient permissions on the device file. I would >> expect this on other unices as well (but I don't know it). >> >> For windows I think it should be similar but not impacting so >> much in practice, because often windows users work with big >> permissions on a somewhat high priviledge level or even >> Administrator. >> >>> If we are to still respect lockfiles, we first need to >>> Understand where we are expected to look for them. Does >>> Anybody have any insight what variants of lockfile folder >>> Schema exist out there in the wild? Some apps like minicom >>> Seem to even allow users to manually specify a lockfile >>> Folder of their choice. >> >> At least my (ancient) minicom does not allow the user to change >> this option, it is displayed but read-only, but root is allowed >> to change it. >> >>> Because of the difficulty finding the right lockfile folder, >>> And because of the inherent risk of thinking that something >>> Might be locked while it actually isn't, I'd suggest that >>> RXTX should have a "soft-off" feature that allows disabling >>> ALL Lockfile checks at runtime without recompiling the native >>> Sharedlibs. >> >> sounds very reasonable, yes... >> and as admin I would not wish that users could skip such >> locking because they do things wrong by default ;) >> >> (in the end I guess that is related to the dilemma, that >> hotplug/user-owned-periphery and multi-user systems simply >> conflict) >> >>> Trent - I like your strategy outline, but I think that it >>> Needs to be configurable by the client such that users and/or >>> Customer Support can disable lockfiles / disable ioctl in >>> Case they detect that they are runing on an OS / Kernal that >>> Does not support one or the other. >> >> Yes, this would be good I guess... Applications could offer >> configuration options to control that, maybe similarily as >> minicom. >> >> BTW, man minicom tells: >> >> *B - Lock file location >> On most systems This should be /usr/spool/uucp. >> Linux systems use /var/lock. If this directory >> does not exist, minicom will not attempt to use >> lockfiles. >> >> The statement `Linux systems use /var/lock' is interesting, does >> anyone know the source of this convention? >> >> oki, >> >> Steffen >> >> About Ingenico Throughout the world businesses rely on Ingenico for secure >> and expedient electronic transaction acceptance. Ingenico products leverage >> proven technology, established standards and unparalleled ergonomics to >> provide optimal reliability, versatility and usability. This comprehensive >> range of products is complemented by a global array of services and >> partnerships, enabling businesses in a number of vertical sectors to accept >> transactions anywhere their business takes them. www.ingenico.com This >> message may contain confidential and/or privileged information. If you are >> not the addressee or authorized to receive this for the addressee, you must >> not use, copy, disclose or take any action based on this message or any >> information herein. If you have received this message in error, please >> advise the sender immediately by reply e-mail and delete this message. >> Thank you for your cooperation. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0063.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0061.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0048.html From pboulton at pulsetracer.com Fri Apr 18 14:30:13 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Fri, 18 Apr 2008 13:30:13 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site Message-ID: <480904D5.1060307@pulsetracer.com> Hello, gentle serial porters. I have downloaded the zipped up binaries for use on Windows without Sun's CommAPI, but don't seem able to extract anything from the download. Go to main page, http://www.rxtx.org/ Click on Downloads I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) And I save it to disk. If I try and extract the files with WinZip, Winzip thinks the archive is corrupt. If I try using Windows Explorer, I am able to extract it into a single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than the original .zip. Any help would be much appreciated. Sincerely, Philip Boulton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080418/97d89793/attachment-0046.html From tjarvi at qbang.org Fri Apr 18 19:07:00 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 18 Apr 2008 19:07:00 -0600 (MDT) Subject: [Rxtx] Difficulty opening zip file at rxtx site In-Reply-To: <480904D5.1060307@pulsetracer.com> References: <480904D5.1060307@pulsetracer.com> Message-ID: On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org From pboulton at pulsetracer.com Sat Apr 19 12:46:26 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Sat, 19 Apr 2008 11:46:26 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site References: <480904D5.1060307@pulsetracer.com> Message-ID: <53DB7576450695419E09299104043761A78533@ZTGSERVER.ztg.local> I have been able to get my hands on the binaries, by going to the ftp directory /pub/rxtx at ftp.qbang.org,, and ftping the file rxtx-2.1-7-bins-r2.zip . This opens happily with Winzip, and extracts as the set of files that you describe below. I only experience the ill-formed archive problem by clicking the link on the rxtx.org Downloads page (http://rxtx.qbang.org/pub/rxtx/ rxtx-2.1-7-bins-r2.zip ). Not sure what to make of that. Philip Boulton ________________________________ From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Fri 4/18/2008 6:07 PM To: Philip Boulton Cc: rxtx at qbang.org Subject: Re: [Rxtx] Difficulty opening zip file at rxtx site On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080419/147923bb/attachment-0045.html From jlar310 at gmail.com Sat Apr 19 19:11:55 2008 From: jlar310 at gmail.com (Jeff Larsen) Date: Sat, 19 Apr 2008 20:11:55 -0500 Subject: [Rxtx] Moxa serial over Ethernet driver Message-ID: Hi all, I've been using javax.comm for years to communicate with a legacy radio data system. We want to migrate the java side of the system to a VMware Server virtual machine. We've had great success using Moxa DE-303 and 5610 serial over Ethernet appliances and virtual machines for running hylafax. The OS (Linux in this case) uses a kernel driver to communicate with the Moxa via a virtual serial port such as /dev/ttyr00. I want to do the same thing with javax.comm or gnu.io to connect to a virtual serial port. However I'm hitting road blocks everywhere. javax.comm for Linux sees the virtual port, but there are transmission errors. Tried Solaris too, but the Solaris Moxa drivers don't play nice with javax.comm because the driver uses /dev/pts/n instead of /dev/term/x. Next I tried RXTX on Linux, but I'm getting NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX on Solaris. Has anyone used RXTX with serial over Ethernet devices? Any hints on how to make it work? I know that I'm not completely off track because javax.comm does work with Moxa on a Windows platform, but that's just not an option for production deployment. -- Jeff From tjarvi at qbang.org Sat Apr 19 21:08:41 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 19 Apr 2008 21:08:41 -0600 (MDT) Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: yOn Sat, 19 Apr 2008, Jeff Larsen wrote: > Hi all, > > I've been using javax.comm for years to communicate with a legacy > radio data system. We want to migrate the java side of the system to a > VMware Server virtual machine. We've had great success using Moxa > DE-303 and 5610 serial over Ethernet appliances and virtual machines > for running hylafax. The OS (Linux in this case) uses a kernel driver > to communicate with the Moxa via a virtual serial port such as > /dev/ttyr00. > > I want to do the same thing with javax.comm or gnu.io to connect to a > virtual serial port. However I'm hitting road blocks everywhere. > javax.comm for Linux sees the virtual port, but there are transmission > errors. Tried Solaris too, but the Solaris Moxa drivers don't play > nice with javax.comm because the driver uses /dev/pts/n instead of > /dev/term/x. Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris. > > Has anyone used RXTX with serial over Ethernet devices? Any hints on > how to make it work? > > I know that I'm not completely off track because javax.comm does work > with Moxa on a Windows platform, but that's just not an option for > production deployment. > > Moxa should work under linux. There may be minor issues depending upon how complete the kernel driver is but I think it will work. One of the minor issues is /dev/ttyr00 is not enumerated. There are several work arounds documented with the source code and on the wiki. The easiest solution for testing purposes is to make a symbolic link from /dev/ttyr00 to a port that is enumerated such as /dev/ttyS129. You can later alter the rxtx source or use properties to change the enumerated ports. -- Trent Jarvi tjarvi at qbang.org From d.tonhofer at m-plify.com Sun Apr 20 03:33:30 2008 From: d.tonhofer at m-plify.com (David Tonhofer (M-PLIFY S.A.)) Date: Sun, 20 Apr 2008 11:33:30 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: <480B0DEA.5010908@m-plify.com> Jeff Larsen wrote: > Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris It might be that the Java side of RXTX does not recognize that portname. Trying modifying src/RXTXCommDriver.java as described in this case: http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card From ajmas at sympatico.ca Sun Apr 20 16:37:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Apr 2008 18:37:59 -0400 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <480B0DEA.5010908@m-plify.com> References: <480B0DEA.5010908@m-plify.com> Message-ID: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > Jeff Larsen wrote: >> Next I tried RXTX on Linux, but I'm getting >> NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX >> on Solaris > It might be that the Java side of RXTX does not recognize that > portname. > Trying modifying src/RXTXCommDriver.java as described in this case: > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card I wonder whether it would be worth allowing custom port prefixes as a system parameter? For example: gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" Andre From Martin.Oberhuber at windriver.com Tue Apr 22 12:34:36 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 22 Apr 2008 20:34:36 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> References: <480B0DEA.5010908@m-plify.com> <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE6485848056CD6CE@ism-mail03.corp.ad.wrs.com> Sounds like a great idea... I'm wondering how the "variable part" after the Prefixes could be specified though? What about allowing Regular Expression character Classes in the existing System Property for specifying ports: System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyS[0-9],ttyS[ABC],ttyUSB[0-9a-z]"); The set of allowed patterns would of course need to Be restricted compared to REGEX, because it must be A syntax that supports iterating over it. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Montag, 21. April 2008 00:38 > To: rxtx at qbang.org and Users > Subject: Re: [Rxtx] Moxa serial over Ethernet driver > > > On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > > Jeff Larsen wrote: > >> Next I tried RXTX on Linux, but I'm getting > >> NoSuchPortException connecting to /dev/ttyr00. I have yet > to try RXTX > >> on Solaris > > It might be that the Java side of RXTX does not recognize that > > portname. > > Trying modifying src/RXTXCommDriver.java as described in this case: > > > > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_ > SST-4P.2FLP_multiport_card > > I wonder whether it would be worth allowing custom port > prefixes as a > system parameter? For > example: > > gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Loi.TRAN at weatherford.com Tue Apr 22 13:10:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Tue, 22 Apr 2008 14:10:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled Message-ID: Hi, I'm currently using the Java RXTX API to interface to a serial port. The serial port is connected to a bridge board that communicates with our communications system running at 1.875 Mbps which is linked to an embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no flow control). I send a command to the embedded board through the serial-bridge board which then is relayed to the embedded board. The command sent asks the embedded board to dump a binary image. Here's where I'm hitting some problems. I've successfully done this is an integrated serial port from the laptop. The binary file that comes back is consistent on every attempt. When I use the application I've written to do the same thing with a USB-to-serial adapter, the image I get back is not the same as the image I receive through the USB-to-serial adapter is not consistent at all. A final thing is that when I use a terminal program to dump the binary image with the USB-serial adapter, the image is correct. Every time! What is the terminal program doing that's not being done in my application? My application is quite simple. Has anyone observed this behavior before? If you have, I'd like to know how you've gotten around this problem. Thanks, LT =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From tjarvi at qbang.org Tue Apr 22 21:11:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 22 Apr 2008 21:11:10 -0600 (MDT) Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org From Loi.TRAN at weatherford.com Wed Apr 23 08:35:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Wed, 23 Apr 2008 09:35:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: Thanks for all the responses. I finally tried something that worked consistently. I updated my Prolific driver and repeated my tests. It worked. If you're using the Prolific type USB-serial adapters, do no use the Prolific version 2.0.2.1 driver on Windows. Update it to the latest 2.0.2.8 version. Again, thanks for all the responses. LT -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Tuesday, April 22, 2008 10:11 PM To: TRAN, Loi X. Cc: rxtx at qbang.org Subject: Re: [Rxtx] Prolific USB - RXTX data mangled On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From Martin.Oberhuber at windriver.com Wed Apr 23 18:54:26 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 02:54:26 +0200 Subject: [Rxtx] RXTX port locking on Linux status? Message-ID: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Dear RXTX community, I'm wondering what the status is with RXTX locking serial ports on Linux? My understanding is that the mechanism used in 2.1-7r2 (lockfiles) is not really state of the art, and has lots of problems (e.g. missing permissions). There was an idea to migrate towards a Kernel syscall based solution for port locking. What's the status here? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/9878db9f/attachment-0041.html From tjarvi at qbang.org Wed Apr 23 20:32:24 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Apr 2008 20:32:24 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > Dear RXTX community, > > I'm wondering what the status is with RXTX locking > serial ports on Linux? > > My understanding is that the mechanism used in > 2.1-7r2 (lockfiles) is not really state of the art, and > has lots of problems (e.g. missing permissions). > > There was an idea to migrate towards a Kernel > syscall based solution for port locking. > > What's the status here? > Hi Martin, I'm in favor of deprecating the current FHS locking mechanism in favor of an IOCTL when available. I think it will be available on all the platforms but do not know for sure. The status is unchanged. I've had very few free cycles for such things. Feel free to take a stab at it if you have some time. I believe the IOCTL is used in the Mac OS X code already. I don't see any real backwards compatability issues and the IOCTL should just work. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Apr 24 06:14:06 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 14:14:06 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Thanks Trent. Problem is only that I'm really not at all Familiar with the C part of RXTX. If there Were anything I could do in Java for this, It would be easier for me.... ... Are there any C experts here on the list Who'd like to look at ioctl port locking For linux? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Donnerstag, 24. April 2008 04:32 > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > I'm wondering what the status is with RXTX locking > > serial ports on Linux? > > > > My understanding is that the mechanism used in > > 2.1-7r2 (lockfiles) is not really state of the art, and > > has lots of problems (e.g. missing permissions). > > > > There was an idea to migrate towards a Kernel > > syscall based solution for port locking. > > > > What's the status here? > > > > Hi Martin, > > I'm in favor of deprecating the current FHS locking mechanism > in favor of > an IOCTL when available. I think it will be available on all the > platforms but do not know for sure. > > The status is unchanged. I've had very few free cycles for > such things. > Feel free to take a stab at it if you have some time. I > believe the IOCTL > is used in the Mac OS X code already. > > I don't see any real backwards compatability issues and the > IOCTL should > just work. > > -- > Trent Jarvi > tjarvi at qbang.org > From sspies at sloc.de Thu Apr 24 07:15:36 2008 From: sspies at sloc.de (Sebastian Spies) Date: Thu, 24 Apr 2008 15:15:36 +0200 (CEST) Subject: [Rxtx] rxtx on gumstix: Interrupted system call In-Reply-To: <47FB7B20.7080504@sloc.de> References: <47FB7B20.7080504@sloc.de> Message-ID: <55445.130.83.139.205.1209042936.squirrel@ssl.sloc.de> Dear list, while porting rxtx to the gumstix, I found out, that select used in readArray in SerialImp.c might not work as expected. Maybe, because of missing TIOCSERGETLSR-support? select is often interrupted, so i wrote the following quick'n'dirty hack to make it work on gumstix: diff -Nur rxtx-2.1-7r2/src/SerialImp.c rxtx-2.1-7r2/src/SerialImp.c --- rxtx-2.1-7r2/src/SerialImp.c 2006-01-29 23:19:04.000000000 +0100 +++ rxtx-2.1-7r2-patched/src/SerialImp.c 2008-04-24 14:30:17.000000000 +0200 @@ -3380,7 +3381,7 @@ JNIEXPORT jint JNICALL RXTXPort(readArray)( JNIEnv *env, jobject jobj, jbyteArray jbarray, jint offset, jint length ) { - int bytes; + int bytes = 0; jbyte *body; /* char msg[80]; */ int fd = get_java_var( env, jobj, "fd", "I" ); @@ -3397,9 +3398,18 @@ "readArray", "Invalid length" ); return -1; } - body = (*env)->GetByteArrayElements( env, jbarray, 0 ); - bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ - (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + while(1 > bytes) + { + body = (*env)->GetByteArrayElements( env, jbarray, 0 ); + bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ + (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + // quick'n'dirty - SSP + report (" trying again... \n"); + errno = 0; + } + if( bytes < 0 ) { report( "RXTXPort:readArray bytes < 0" ); LEAVE( "RXTXPort:readArray" ); > Hey, > > I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use > RXTXPort$SerialInputStream.read(), then I get the following Exception. I > did not yet figure out which system call is interrupted as strace > produces loads of output. > > Any help would be very appreciated. Thanks in advance. > Sebastian > > > [java] java.io.IOException: Interrupted system call in readArray > [java] at gnu.io.RXTXPort.readArray(Native Method) > [java] at > gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) > [java] at > java.io.FilterInputStream.read(FilterInputStream.java:189) > [java] at > java.io.BufferedInputStream.refill(BufferedInputStream.java:371) > [java] at > java.io.BufferedInputStream.read(BufferedInputStream.java:229) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) > [java] at > com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) > > -- > Sebastian Spies > > mail: sspies at sloc.de > > > > From fire_baptized at hotmail.com Thu Apr 24 18:27:48 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Thu, 24 Apr 2008 20:27:48 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hello I am having a problem with the serial device connecting (software wise) to the serial port. However I have a test program and it seems to work just fine in that environment - and it doesnt use GUI. The error I am getting is : PortNotFoundException Now the way I have it setup in the GUI environment is that once the user pushes a JButton the program connects using this class: protected void establishConnection() { try { portId = CommPortIdentifier.getPortIdentifier("COM3"); System.out.println("Establishing connction....."); messages[0] = "\nEstablishing connction.....\n"; } catch ( NoSuchPortException noport) { System.out.println("Port not found: "+ noport); messages[0] = "Port not found: "+ noport+"\n"; } try { serialPort = (SerialPort) portId.open("serial", 50); System.out.println("Port has been found."); messages[1] = "Port has been found.\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[1] = "" +usedport; } try { serialPort = (SerialPort) portId.open("serial", 50); messages[2] = "Connecting to COM3 on port 50....\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; } try { serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); System.out.println("Esablishing the transfer rate settings for COM3."); messages[3] = "Esablishing the transfer rate settings for COM3.\n"; } catch (UnsupportedCommOperationException nosupcom) { System.out.println(nosupcom); System.out.println("The tranfer rate could not be esblished on COM3."); messages[3] = "The tranfer rate could not be esblished on COM3.\n"; } System.out.println(serialPort.getFlowControlMode()); messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; //sendDataOut(buffer[3],buffer[4]); } I need all the data in this method (and all the string values in this method) to be printed out on a JTextArea. I wont do me any good if not all the text is printed on a JTextArea in another class. So I have the text printing the JTextArea correctly, but everytime the JButton is activated - it gives me that error message. I did add a disconnect button that is supposed to call the serialPort.close(). _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/273fd4ec/attachment-0040.html From tjarvi at qbang.org Thu Apr 24 21:54:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Apr 2008 21:54:10 -0600 (MDT) Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > Hello I am having a problem with the serial device connecting (software > wise) to the serial port. However I have a test program and it seems to > work just fine in that environment - and it doesnt use GUI. The error I > am getting is : PortNotFoundException Now the way I have it setup in the > GUI environment is that once the user pushes a JButton the program > connects using this class: > > protected void establishConnection() { > try { > portId = CommPortIdentifier.getPortIdentifier("COM3"); > System.out.println("Establishing connction....."); > messages[0] = "\nEstablishing connction.....\n"; > } > catch ( NoSuchPortException noport) { > System.out.println("Port not found: "+ noport); > messages[0] = "Port not found: "+ noport+"\n"; > } > try { > serialPort = (SerialPort) portId.open("serial", 50); > System.out.println("Port has been found."); > messages[1] = "Port has been found.\n"; > } > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[1] = "" +usedport; > } ================================================================= > try { > serialPort = (SerialPort) portId.open("serial", 50); > messages[2] = "Connecting to COM3 on port 50....\n"; > } ================================================================== > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > } > try { > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > System.out.println("Esablishing the transfer rate settings for COM3."); > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > } > catch (UnsupportedCommOperationException nosupcom) { > System.out.println(nosupcom); > System.out.println("The tranfer rate could not be esblished on COM3."); > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > } > System.out.println(serialPort.getFlowControlMode()); > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > //sendDataOut(buffer[3],buffer[4]); > } > > I need all the data in this method (and all the string values in this > method) to be printed out on a JTextArea. I wont do me any good if not > all the text is printed on a JTextArea in another class. So I have the > text printing the JTextArea correctly, but everytime the JButton is > activated - it gives me that error message. I did add a disconnect > button that is supposed to call the serialPort.close(). > The open code used twice is going to throw an exception. It may be that you catch the exception above this code and print a confusing message? A common mistake is people will accidently run two copies of their program. The first instance of the program will open the port and prevent enumeration (finding the port) in the second instance of the program. As an example, you may be running your text based application which is preventing the GUI from seeing the port. Enumeration is done by trying to open the port. If the port is open, Enumeration fails. -- Trent Jarvi tjarvi at qbang.org From fire_baptized at hotmail.com Thu Apr 24 22:32:05 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 00:32:05 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Wow - thanks dude what a dumb thing for me to not catch..... now here is the current problem - right now I am trying to output data again one is with the test program - and it seems that serialPort.setRTS(true); is throwing an exceptions there - now if I show this code please bare in mind that I am only testing - the code is kinda sloppy in my mind - but if I can figure out why calling this function is throwing an exception then maybe I can figure out why my GUI application is getting the same null pointer exceptions when try to send out the data stream. FYI Trent this email is not directed towards you - anyone can jump in on this public static void main(String args[]) { byte[] b = new byte[64]; int keyinput = 0 ; byte x = 0; byte y = 0; PortTesting1 testports = new PortTesting1(); try { joyskoro = Joystick.createInstance(); } catch (IOException ioexc) { System.out.println("There is an input/output problem: " + ioexc); } while (true) { joyskoro.poll(); b[0] = ((byte) -(10 * joyskoro.getY())); b[1] = ((byte) (10 * joyskoro.getX())); System.out.println("The 3rd byte is: " +b[0]); System.out.println("The 4rd byte is: " +b[1]); serialPort.setRTS(true); // HERE IS WHERE THE PROBLEM IS !!!!!!! ON THIS LINE but if I dont have it active in my program the Bluetooth device (that is System.out.println("Ready to send :-) !"); //connected to the serial port does not send out data!!!!! if (joyskoro.isButtonDown(joyskoro.BUTTON10)) { System.out.println("Connection terminated."); serialPort.close(); break; } if (joyskoro.isButtonDown(joyskoro.BUTTON2)) { boolean flag = true; //reading from key input from the keyboard System.out.println("Please input a command: "); while (flag) { try { keyinput = System.in.read(); } catch (IOException ioexc) {/*there is no need to put * anything here */ } if((char)keyinput=='w') { pushIt((byte)85); } if((char)keyinput=='s') { pushIt((byte)84); } if((char)keyinput=='a') { pushIt((byte)83); } if((char)keyinput=='d') { pushIt((byte)82); } if((char)keyinput=='q') { pushIt((byte)89); } if((char)keyinput=='\t') { //this stop reading input from the keyboard flag = false; } } and help anyways here is the block of code that throwing an exception for the test program: > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/5c8f7d68/attachment-0040.html From fire_baptized at hotmail.com Fri Apr 25 07:59:53 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 09:59:53 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Are there any examples of how to push out data? As in using input and output streams - if I can compare code maybe I can see where this is causing a problem. I have a byte array that I am pushing out data. I keep getting null pointer exceptions every where I turn. > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/22228ab6/attachment-0039.html From ajmas at sympatico.ca Sat Apr 26 07:37:09 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 26 Apr 2008 09:37:09 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hi, On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote: > > Are there any examples of how to push out data? As in using input > and output streams - if I can compare code maybe I can see where > this is causing a problem. I have a byte array that I am pushing > out data. I keep getting null pointer exceptions every where I turn. > There are some examples here that might be of help: http://rxtx.qbang.org/wiki/index.php/Examples Andre From fire_baptized at hotmail.com Sat Apr 26 20:13:54 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Sat, 26 Apr 2008 22:13:54 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: looked at those....yep didnt help - I need to push out data with GUI and not get a null pointer exception everytime I try. > CC: rxtx at qbang.org> From: ajmas at sympatico.ca> To: fire_baptized at hotmail.com> Subject: Re: [Rxtx] Serial Problems with Gui.....> Date: Sat, 26 Apr 2008 09:37:09 -0400> > Hi,> > > On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote:> >> > Are there any examples of how to push out data? As in using input > > and output streams - if I can compare code maybe I can see where > > this is causing a problem. I have a byte array that I am pushing > > out data. I keep getting null pointer exceptions every where I turn.> >> > There are some examples here that might be of help:> > http://rxtx.qbang.org/wiki/index.php/Examples> > Andre _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080426/09f95b41/attachment-0038.html From michael.erskine at ketech.com Mon Apr 28 02:47:22 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 28 Apr 2008 09:47:22 +0100 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D426EF3CBBC5@no-sv-03.ketech.local> Jesrael D. Summerhill wrote: > looked at those....yep didnt help - I need to push out data with GUI and > not get a null pointer exception everytime I try. So it seems pretty obvious that your code needs to check for nulls wherever one may occur and report what's happening. Alternatively, catch the npe and display the stack trace. Then you can fix your code so it doesn't try to work with something that ain't there. Regards, Michael Erskine. From scldad at sdc.com.au Mon Apr 28 03:58:34 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Mon, 28 Apr 2008 19:28:34 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Message-ID: <200804281928.34454.scldad@sdc.com.au> Has anybody done any design work on this? The first thing that springs to mind is that we still need to check for lock files because other apps tend to use that approach even if we go to ioctl. Cheers, Stephen Davies On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > Thanks Trent. > > Problem is only that I'm really not at all > Familiar with the C part of RXTX. If there > Were anything I could do in Java for this, > It would be easier for me.... > > ... Are there any C experts here on the list > Who'd like to look at ioctl port locking > For linux? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > -----Original Message----- > > From: Trent Jarvi [mailto:tjarvi at qbang.org] > > Sent: Donnerstag, 24. April 2008 04:32 > > To: Oberhuber, Martin > > Cc: rxtx at qbang.org > > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > > > I'm wondering what the status is with RXTX locking > > > serial ports on Linux? > > > > > > My understanding is that the mechanism used in > > > 2.1-7r2 (lockfiles) is not really state of the art, and > > > has lots of problems (e.g. missing permissions). > > > > > > There was an idea to migrate towards a Kernel > > > syscall based solution for port locking. > > > > > > What's the status here? > > > > Hi Martin, > > > > I'm in favor of deprecating the current FHS locking mechanism > > in favor of > > an IOCTL when available. I think it will be available on all the > > platforms but do not know for sure. > > > > The status is unchanged. I've had very few free cycles for > > such things. > > Feel free to take a stab at it if you have some time. I > > believe the IOCTL > > is used in the Mac OS X code already. > > > > I don't see any real backwards compatability issues and the > > IOCTL should > > just work. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Mon Apr 28 04:21:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 28 Apr 2008 04:21:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804281928.34454.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: I don't think there would need to be any architectural changes. A couple ifdefs and minor changes in the current code should be enough. Proposal: FHS/UUCP locks: continue to respect them, try to create them but do not error if the IOCTL is supported. (But does the IOCTL being defined mean it will work?) Enumeration: Do not assert the IOCTL while opening. Serial.open: assert the IOCTL after open. Continue to use locks as described above after asserting the IOCTL. If the IOCTL is defined but not working, handle it here. Failure cases include the IOCTL is not supported and the port is already locked. On Mon, 28 Apr 2008, Stephen Davies wrote: > Has anybody done any design work on this? > The first thing that springs to mind is that we still need to check for lock > files because other apps tend to use that approach even if we go to ioctl. > > Cheers, > Stephen Davies > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: >> Thanks Trent. >> >> Problem is only that I'm really not at all >> Familiar with the C part of RXTX. If there >> Were anything I could do in Java for this, >> It would be easier for me.... >> >> ... Are there any C experts here on the list >> Who'd like to look at ioctl port locking >> For linux? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >>> -----Original Message----- >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] >>> Sent: Donnerstag, 24. April 2008 04:32 >>> To: Oberhuber, Martin >>> Cc: rxtx at qbang.org >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? >>> >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: >>>> Dear RXTX community, >>>> >>>> I'm wondering what the status is with RXTX locking >>>> serial ports on Linux? >>>> >>>> My understanding is that the mechanism used in >>>> 2.1-7r2 (lockfiles) is not really state of the art, and >>>> has lots of problems (e.g. missing permissions). >>>> >>>> There was an idea to migrate towards a Kernel >>>> syscall based solution for port locking. >>>> >>>> What's the status here? >>> >>> Hi Martin, >>> >>> I'm in favor of deprecating the current FHS locking mechanism >>> in favor of >>> an IOCTL when available. I think it will be available on all the >>> platforms but do not know for sure. >>> >>> The status is unchanged. I've had very few free cycles for >>> such things. >>> Feel free to take a stab at it if you have some time. I >>> believe the IOCTL >>> is used in the Mac OS X code already. >>> >>> I don't see any real backwards compatability issues and the >>> IOCTL should >>> just work. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Tue Apr 29 12:04:04 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Apr 2008 20:04:04 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Hi all, The biggest problem that I have seen with lockfiles on Linux At least is, that it seems there is no standard with respect To the folder in which they should be created. Also, many Distributions seem to set up file system permissions in such A way that writing to the lockfile folder is not allowed for The normal user -- that's why we stopped using lockfiles In our commercial product. If we are to still respect lockfiles, we first need to Understand where we are expected to look for them. Does Anybody have any insight what variants of lockfile folder Schema exist out there in the wild? Some apps like minicom Seem to even allow users to manually specify a lockfile Folder of their choice. Because of the difficulty finding the right lockfile folder, And because of the inherent risk of thinking that something Might be locked while it actually isn't, I'd suggest that RXTX should have a "soft-off" feature that allows disabling ALL Lockfile checks at runtime without recompiling the native Sharedlibs. Trent - I like your strategy outline, but I think that it Needs to be configurable by the client such that users and/or Customer Support can disable lockfiles / disable ioctl in Case they detect that they are runing on an OS / Kernal that Does not support one or the other. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Montag, 28. April 2008 12:22 > To: Stephen Davies > Cc: rxtx at qbang.org; Oberhuber, Martin; Trent Jarvi > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > I don't think there would need to be any architectural > changes. A couple > ifdefs and minor changes in the current code should be enough. > > Proposal: > > FHS/UUCP locks: > continue to respect them, try to create them but do not error if > the IOCTL is supported. (But does the IOCTL being defined mean > it will work?) > Enumeration: > Do not assert the IOCTL while opening. > Serial.open: > assert the IOCTL after open. Continue to use locks as described > above after asserting the IOCTL. If the IOCTL is defined but > not working, handle it here. Failure cases include the IOCTL > is not supported and the port is already locked. > > On Mon, 28 Apr 2008, Stephen Davies wrote: > > > Has anybody done any design work on this? > > The first thing that springs to mind is that we still need > to check for lock > > files because other apps tend to use that approach even if > we go to ioctl. > > > > Cheers, > > Stephen Davies > > > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > >> Thanks Trent. > >> > >> Problem is only that I'm really not at all > >> Familiar with the C part of RXTX. If there > >> Were anything I could do in Java for this, > >> It would be easier for me.... > >> > >> ... Are there any C experts here on the list > >> Who'd like to look at ioctl port locking > >> For linux? > >> > >> Thanks, > >> -- > >> Martin Oberhuber, Senior Member of Technical Staff, Wind River > >> Target Management Project Lead, DSDP PMC Member > >> http://www.eclipse.org/dsdp/tm > >> > >>> -----Original Message----- > >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] > >>> Sent: Donnerstag, 24. April 2008 04:32 > >>> To: Oberhuber, Martin > >>> Cc: rxtx at qbang.org > >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? > >>> > >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > >>>> Dear RXTX community, > >>>> > >>>> I'm wondering what the status is with RXTX locking > >>>> serial ports on Linux? > >>>> > >>>> My understanding is that the mechanism used in > >>>> 2.1-7r2 (lockfiles) is not really state of the art, and > >>>> has lots of problems (e.g. missing permissions). > >>>> > >>>> There was an idea to migrate towards a Kernel > >>>> syscall based solution for port locking. > >>>> > >>>> What's the status here? > >>> > >>> Hi Martin, > >>> > >>> I'm in favor of deprecating the current FHS locking mechanism > >>> in favor of > >>> an IOCTL when available. I think it will be available on all the > >>> platforms but do not know for sure. > >>> > >>> The status is unchanged. I've had very few free cycles for > >>> such things. > >>> Feel free to take a stab at it if you have some time. I > >>> believe the IOCTL > >>> is used in the Mac OS X code already. > >>> > >>> I don't see any real backwards compatability issues and the > >>> IOCTL should > >>> just work. > >>> > >>> -- > >>> Trent Jarvi > >>> tjarvi at qbang.org > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > From Steffen.DETTMER at ingenico.com Tue Apr 29 13:34:44 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 29 Apr 2008 21:34:44 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Message-ID: <20080429193444.GU2928@elberon.bln.de.ingenico.com> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > The biggest problem that I have seen with lockfiles on Linux > At least is, that it seems there is no standard with respect > To the folder in which they should be created. Also, many > Distributions seem to set up file system permissions in such > A way that writing to the lockfile folder is not allowed for > The normal user -- that's why we stopped using lockfiles > In our commercial product. It seems it depends on the expectations. I consider it as a feature that by default a linux user cannot access serial ports. Maybe root connected a modem (can produce phone bills) or even some serial card reader, maybe with the web servers key pair. I would expect that by default a user cannot open the serial port because of insufficient permissions on the device file. I would expect this on other unices as well (but I don't know it). For windows I think it should be similar but not impacting so much in practice, because often windows users work with big permissions on a somewhat high priviledge level or even Administrator. > If we are to still respect lockfiles, we first need to > Understand where we are expected to look for them. Does > Anybody have any insight what variants of lockfile folder > Schema exist out there in the wild? Some apps like minicom > Seem to even allow users to manually specify a lockfile > Folder of their choice. At least my (ancient) minicom does not allow the user to change this option, it is displayed but read-only, but root is allowed to change it. > Because of the difficulty finding the right lockfile folder, > And because of the inherent risk of thinking that something > Might be locked while it actually isn't, I'd suggest that > RXTX should have a "soft-off" feature that allows disabling > ALL Lockfile checks at runtime without recompiling the native > Sharedlibs. sounds very reasonable, yes... and as admin I would not wish that users could skip such locking because they do things wrong by default ;) (in the end I guess that is related to the dilemma, that hotplug/user-owned-periphery and multi-user systems simply conflict) > Trent - I like your strategy outline, but I think that it > Needs to be configurable by the client such that users and/or > Customer Support can disable lockfiles / disable ioctl in > Case they detect that they are runing on an OS / Kernal that > Does not support one or the other. Yes, this would be good I guess... Applications could offer configuration options to control that, maybe similarily as minicom. BTW, man minicom tells: *B - Lock file location On most systems This should be /usr/spool/uucp. Linux systems use /var/lock. If this directory does not exist, minicom will not attempt to use lockfiles. The statement `Linux systems use /var/lock' is interesting, does anyone know the source of this convention? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Tue Apr 29 16:11:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Apr 2008 16:11:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? These details are outlined in the Filesystem Hierarchy Standard (FHS). http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLOCKLOCKFILES -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Tue Apr 29 18:58:09 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Wed, 30 Apr 2008 10:28:09 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: <200804301028.09307.scldad@sdc.com.au> I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is the same. Any ideas as to how to handle this? Stephen On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: > * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > > The biggest problem that I have seen with lockfiles on Linux > > At least is, that it seems there is no standard with respect > > To the folder in which they should be created. Also, many > > Distributions seem to set up file system permissions in such > > A way that writing to the lockfile folder is not allowed for > > The normal user -- that's why we stopped using lockfiles > > In our commercial product. > > It seems it depends on the expectations. I consider it as a > feature that by default a linux user cannot access serial ports. > Maybe root connected a modem (can produce phone bills) or even > some serial card reader, maybe with the web servers key pair. > > I would expect that by default a user cannot open the serial port > because of insufficient permissions on the device file. I would > expect this on other unices as well (but I don't know it). > > For windows I think it should be similar but not impacting so > much in practice, because often windows users work with big > permissions on a somewhat high priviledge level or even > Administrator. > > > If we are to still respect lockfiles, we first need to > > Understand where we are expected to look for them. Does > > Anybody have any insight what variants of lockfile folder > > Schema exist out there in the wild? Some apps like minicom > > Seem to even allow users to manually specify a lockfile > > Folder of their choice. > > At least my (ancient) minicom does not allow the user to change > this option, it is displayed but read-only, but root is allowed > to change it. > > > Because of the difficulty finding the right lockfile folder, > > And because of the inherent risk of thinking that something > > Might be locked while it actually isn't, I'd suggest that > > RXTX should have a "soft-off" feature that allows disabling > > ALL Lockfile checks at runtime without recompiling the native > > Sharedlibs. > > sounds very reasonable, yes... > and as admin I would not wish that users could skip such > locking because they do things wrong by default ;) > > (in the end I guess that is related to the dilemma, that > hotplug/user-owned-periphery and multi-user systems simply > conflict) > > > Trent - I like your strategy outline, but I think that it > > Needs to be configurable by the client such that users and/or > > Customer Support can disable lockfiles / disable ioctl in > > Case they detect that they are runing on an OS / Kernal that > > Does not support one or the other. > > Yes, this would be good I guess... Applications could offer > configuration options to control that, maybe similarily as > minicom. > > BTW, man minicom tells: > > *B - Lock file location > On most systems This should be /usr/spool/uucp. > Linux systems use /var/lock. If this directory > does not exist, minicom will not attempt to use > lockfiles. > > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure > and expedient electronic transaction acceptance. Ingenico products leverage > proven technology, established standards and unparalleled ergonomics to > provide optimal reliability, versatility and usability. This comprehensive > range of products is complemented by a global array of services and > partnerships, enabling businesses in a number of vertical sectors to accept > transactions anywhere their business takes them. www.ingenico.com This > message may contain confidential and/or privileged information. If you are > not the addressee or authorized to receive this for the addressee, you must > not use, copy, disclose or take any action based on this message or any > information herein. If you have received this message in error, please > advise the sender immediately by reply e-mail and delete this message. > Thank you for your cooperation. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Wed Apr 30 19:30:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 30 Apr 2008 19:30:51 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804301028.09307.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> <200804301028.09307.scldad@sdc.com.au> Message-ID: Hi Stephen, I suspect ioctl/TIOCEXCL open/O_EXCL would do the job. Mac uses TIOCEXCL and it is POSIX. We use O_EXCL for lockfiles on Linux already. On Wed, 30 Apr 2008, Stephen Davies wrote: > I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is > the same. > > Any ideas as to how to handle this? > > Stephen > > > On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: >> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: >>> The biggest problem that I have seen with lockfiles on Linux >>> At least is, that it seems there is no standard with respect >>> To the folder in which they should be created. Also, many >>> Distributions seem to set up file system permissions in such >>> A way that writing to the lockfile folder is not allowed for >>> The normal user -- that's why we stopped using lockfiles >>> In our commercial product. >> >> It seems it depends on the expectations. I consider it as a >> feature that by default a linux user cannot access serial ports. >> Maybe root connected a modem (can produce phone bills) or even >> some serial card reader, maybe with the web servers key pair. >> >> I would expect that by default a user cannot open the serial port >> because of insufficient permissions on the device file. I would >> expect this on other unices as well (but I don't know it). >> >> For windows I think it should be similar but not impacting so >> much in practice, because often windows users work with big >> permissions on a somewhat high priviledge level or even >> Administrator. >> >>> If we are to still respect lockfiles, we first need to >>> Understand where we are expected to look for them. Does >>> Anybody have any insight what variants of lockfile folder >>> Schema exist out there in the wild? Some apps like minicom >>> Seem to even allow users to manually specify a lockfile >>> Folder of their choice. >> >> At least my (ancient) minicom does not allow the user to change >> this option, it is displayed but read-only, but root is allowed >> to change it. >> >>> Because of the difficulty finding the right lockfile folder, >>> And because of the inherent risk of thinking that something >>> Might be locked while it actually isn't, I'd suggest that >>> RXTX should have a "soft-off" feature that allows disabling >>> ALL Lockfile checks at runtime without recompiling the native >>> Sharedlibs. >> >> sounds very reasonable, yes... >> and as admin I would not wish that users could skip such >> locking because they do things wrong by default ;) >> >> (in the end I guess that is related to the dilemma, that >> hotplug/user-owned-periphery and multi-user systems simply >> conflict) >> >>> Trent - I like your strategy outline, but I think that it >>> Needs to be configurable by the client such that users and/or >>> Customer Support can disable lockfiles / disable ioctl in >>> Case they detect that they are runing on an OS / Kernal that >>> Does not support one or the other. >> >> Yes, this would be good I guess... Applications could offer >> configuration options to control that, maybe similarily as >> minicom. >> >> BTW, man minicom tells: >> >> *B - Lock file location >> On most systems This should be /usr/spool/uucp. >> Linux systems use /var/lock. If this directory >> does not exist, minicom will not attempt to use >> lockfiles. >> >> The statement `Linux systems use /var/lock' is interesting, does >> anyone know the source of this convention? >> >> oki, >> >> Steffen >> >> About Ingenico Throughout the world businesses rely on Ingenico for secure >> and expedient electronic transaction acceptance. Ingenico products leverage >> proven technology, established standards and unparalleled ergonomics to >> provide optimal reliability, versatility and usability. This comprehensive >> range of products is complemented by a global array of services and >> partnerships, enabling businesses in a number of vertical sectors to accept >> transactions anywhere their business takes them. www.ingenico.com This >> message may contain confidential and/or privileged information. If you are >> not the addressee or authorized to receive this for the addressee, you must >> not use, copy, disclose or take any action based on this message or any >> information herein. If you have received this message in error, please >> advise the sender immediately by reply e-mail and delete this message. >> Thank you for your cooperation. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0064.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0062.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0049.html From pboulton at pulsetracer.com Fri Apr 18 14:30:13 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Fri, 18 Apr 2008 13:30:13 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site Message-ID: <480904D5.1060307@pulsetracer.com> Hello, gentle serial porters. I have downloaded the zipped up binaries for use on Windows without Sun's CommAPI, but don't seem able to extract anything from the download. Go to main page, http://www.rxtx.org/ Click on Downloads I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) And I save it to disk. If I try and extract the files with WinZip, Winzip thinks the archive is corrupt. If I try using Windows Explorer, I am able to extract it into a single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than the original .zip. Any help would be much appreciated. Sincerely, Philip Boulton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080418/97d89793/attachment-0047.html From tjarvi at qbang.org Fri Apr 18 19:07:00 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 18 Apr 2008 19:07:00 -0600 (MDT) Subject: [Rxtx] Difficulty opening zip file at rxtx site In-Reply-To: <480904D5.1060307@pulsetracer.com> References: <480904D5.1060307@pulsetracer.com> Message-ID: On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org From pboulton at pulsetracer.com Sat Apr 19 12:46:26 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Sat, 19 Apr 2008 11:46:26 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site References: <480904D5.1060307@pulsetracer.com> Message-ID: <53DB7576450695419E09299104043761A78533@ZTGSERVER.ztg.local> I have been able to get my hands on the binaries, by going to the ftp directory /pub/rxtx at ftp.qbang.org,, and ftping the file rxtx-2.1-7-bins-r2.zip . This opens happily with Winzip, and extracts as the set of files that you describe below. I only experience the ill-formed archive problem by clicking the link on the rxtx.org Downloads page (http://rxtx.qbang.org/pub/rxtx/ rxtx-2.1-7-bins-r2.zip ). Not sure what to make of that. Philip Boulton ________________________________ From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Fri 4/18/2008 6:07 PM To: Philip Boulton Cc: rxtx at qbang.org Subject: Re: [Rxtx] Difficulty opening zip file at rxtx site On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080419/147923bb/attachment-0046.html From jlar310 at gmail.com Sat Apr 19 19:11:55 2008 From: jlar310 at gmail.com (Jeff Larsen) Date: Sat, 19 Apr 2008 20:11:55 -0500 Subject: [Rxtx] Moxa serial over Ethernet driver Message-ID: Hi all, I've been using javax.comm for years to communicate with a legacy radio data system. We want to migrate the java side of the system to a VMware Server virtual machine. We've had great success using Moxa DE-303 and 5610 serial over Ethernet appliances and virtual machines for running hylafax. The OS (Linux in this case) uses a kernel driver to communicate with the Moxa via a virtual serial port such as /dev/ttyr00. I want to do the same thing with javax.comm or gnu.io to connect to a virtual serial port. However I'm hitting road blocks everywhere. javax.comm for Linux sees the virtual port, but there are transmission errors. Tried Solaris too, but the Solaris Moxa drivers don't play nice with javax.comm because the driver uses /dev/pts/n instead of /dev/term/x. Next I tried RXTX on Linux, but I'm getting NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX on Solaris. Has anyone used RXTX with serial over Ethernet devices? Any hints on how to make it work? I know that I'm not completely off track because javax.comm does work with Moxa on a Windows platform, but that's just not an option for production deployment. -- Jeff From tjarvi at qbang.org Sat Apr 19 21:08:41 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 19 Apr 2008 21:08:41 -0600 (MDT) Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: yOn Sat, 19 Apr 2008, Jeff Larsen wrote: > Hi all, > > I've been using javax.comm for years to communicate with a legacy > radio data system. We want to migrate the java side of the system to a > VMware Server virtual machine. We've had great success using Moxa > DE-303 and 5610 serial over Ethernet appliances and virtual machines > for running hylafax. The OS (Linux in this case) uses a kernel driver > to communicate with the Moxa via a virtual serial port such as > /dev/ttyr00. > > I want to do the same thing with javax.comm or gnu.io to connect to a > virtual serial port. However I'm hitting road blocks everywhere. > javax.comm for Linux sees the virtual port, but there are transmission > errors. Tried Solaris too, but the Solaris Moxa drivers don't play > nice with javax.comm because the driver uses /dev/pts/n instead of > /dev/term/x. Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris. > > Has anyone used RXTX with serial over Ethernet devices? Any hints on > how to make it work? > > I know that I'm not completely off track because javax.comm does work > with Moxa on a Windows platform, but that's just not an option for > production deployment. > > Moxa should work under linux. There may be minor issues depending upon how complete the kernel driver is but I think it will work. One of the minor issues is /dev/ttyr00 is not enumerated. There are several work arounds documented with the source code and on the wiki. The easiest solution for testing purposes is to make a symbolic link from /dev/ttyr00 to a port that is enumerated such as /dev/ttyS129. You can later alter the rxtx source or use properties to change the enumerated ports. -- Trent Jarvi tjarvi at qbang.org From d.tonhofer at m-plify.com Sun Apr 20 03:33:30 2008 From: d.tonhofer at m-plify.com (David Tonhofer (M-PLIFY S.A.)) Date: Sun, 20 Apr 2008 11:33:30 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: <480B0DEA.5010908@m-plify.com> Jeff Larsen wrote: > Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris It might be that the Java side of RXTX does not recognize that portname. Trying modifying src/RXTXCommDriver.java as described in this case: http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card From ajmas at sympatico.ca Sun Apr 20 16:37:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Apr 2008 18:37:59 -0400 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <480B0DEA.5010908@m-plify.com> References: <480B0DEA.5010908@m-plify.com> Message-ID: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > Jeff Larsen wrote: >> Next I tried RXTX on Linux, but I'm getting >> NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX >> on Solaris > It might be that the Java side of RXTX does not recognize that > portname. > Trying modifying src/RXTXCommDriver.java as described in this case: > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card I wonder whether it would be worth allowing custom port prefixes as a system parameter? For example: gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" Andre From Martin.Oberhuber at windriver.com Tue Apr 22 12:34:36 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 22 Apr 2008 20:34:36 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> References: <480B0DEA.5010908@m-plify.com> <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE6485848056CD6CE@ism-mail03.corp.ad.wrs.com> Sounds like a great idea... I'm wondering how the "variable part" after the Prefixes could be specified though? What about allowing Regular Expression character Classes in the existing System Property for specifying ports: System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyS[0-9],ttyS[ABC],ttyUSB[0-9a-z]"); The set of allowed patterns would of course need to Be restricted compared to REGEX, because it must be A syntax that supports iterating over it. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Montag, 21. April 2008 00:38 > To: rxtx at qbang.org and Users > Subject: Re: [Rxtx] Moxa serial over Ethernet driver > > > On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > > Jeff Larsen wrote: > >> Next I tried RXTX on Linux, but I'm getting > >> NoSuchPortException connecting to /dev/ttyr00. I have yet > to try RXTX > >> on Solaris > > It might be that the Java side of RXTX does not recognize that > > portname. > > Trying modifying src/RXTXCommDriver.java as described in this case: > > > > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_ > SST-4P.2FLP_multiport_card > > I wonder whether it would be worth allowing custom port > prefixes as a > system parameter? For > example: > > gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Loi.TRAN at weatherford.com Tue Apr 22 13:10:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Tue, 22 Apr 2008 14:10:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled Message-ID: Hi, I'm currently using the Java RXTX API to interface to a serial port. The serial port is connected to a bridge board that communicates with our communications system running at 1.875 Mbps which is linked to an embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no flow control). I send a command to the embedded board through the serial-bridge board which then is relayed to the embedded board. The command sent asks the embedded board to dump a binary image. Here's where I'm hitting some problems. I've successfully done this is an integrated serial port from the laptop. The binary file that comes back is consistent on every attempt. When I use the application I've written to do the same thing with a USB-to-serial adapter, the image I get back is not the same as the image I receive through the USB-to-serial adapter is not consistent at all. A final thing is that when I use a terminal program to dump the binary image with the USB-serial adapter, the image is correct. Every time! What is the terminal program doing that's not being done in my application? My application is quite simple. Has anyone observed this behavior before? If you have, I'd like to know how you've gotten around this problem. Thanks, LT =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From tjarvi at qbang.org Tue Apr 22 21:11:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 22 Apr 2008 21:11:10 -0600 (MDT) Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org From Loi.TRAN at weatherford.com Wed Apr 23 08:35:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Wed, 23 Apr 2008 09:35:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: Thanks for all the responses. I finally tried something that worked consistently. I updated my Prolific driver and repeated my tests. It worked. If you're using the Prolific type USB-serial adapters, do no use the Prolific version 2.0.2.1 driver on Windows. Update it to the latest 2.0.2.8 version. Again, thanks for all the responses. LT -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Tuesday, April 22, 2008 10:11 PM To: TRAN, Loi X. Cc: rxtx at qbang.org Subject: Re: [Rxtx] Prolific USB - RXTX data mangled On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From Martin.Oberhuber at windriver.com Wed Apr 23 18:54:26 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 02:54:26 +0200 Subject: [Rxtx] RXTX port locking on Linux status? Message-ID: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Dear RXTX community, I'm wondering what the status is with RXTX locking serial ports on Linux? My understanding is that the mechanism used in 2.1-7r2 (lockfiles) is not really state of the art, and has lots of problems (e.g. missing permissions). There was an idea to migrate towards a Kernel syscall based solution for port locking. What's the status here? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/9878db9f/attachment-0042.html From tjarvi at qbang.org Wed Apr 23 20:32:24 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Apr 2008 20:32:24 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > Dear RXTX community, > > I'm wondering what the status is with RXTX locking > serial ports on Linux? > > My understanding is that the mechanism used in > 2.1-7r2 (lockfiles) is not really state of the art, and > has lots of problems (e.g. missing permissions). > > There was an idea to migrate towards a Kernel > syscall based solution for port locking. > > What's the status here? > Hi Martin, I'm in favor of deprecating the current FHS locking mechanism in favor of an IOCTL when available. I think it will be available on all the platforms but do not know for sure. The status is unchanged. I've had very few free cycles for such things. Feel free to take a stab at it if you have some time. I believe the IOCTL is used in the Mac OS X code already. I don't see any real backwards compatability issues and the IOCTL should just work. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Apr 24 06:14:06 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 14:14:06 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Thanks Trent. Problem is only that I'm really not at all Familiar with the C part of RXTX. If there Were anything I could do in Java for this, It would be easier for me.... ... Are there any C experts here on the list Who'd like to look at ioctl port locking For linux? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Donnerstag, 24. April 2008 04:32 > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > I'm wondering what the status is with RXTX locking > > serial ports on Linux? > > > > My understanding is that the mechanism used in > > 2.1-7r2 (lockfiles) is not really state of the art, and > > has lots of problems (e.g. missing permissions). > > > > There was an idea to migrate towards a Kernel > > syscall based solution for port locking. > > > > What's the status here? > > > > Hi Martin, > > I'm in favor of deprecating the current FHS locking mechanism > in favor of > an IOCTL when available. I think it will be available on all the > platforms but do not know for sure. > > The status is unchanged. I've had very few free cycles for > such things. > Feel free to take a stab at it if you have some time. I > believe the IOCTL > is used in the Mac OS X code already. > > I don't see any real backwards compatability issues and the > IOCTL should > just work. > > -- > Trent Jarvi > tjarvi at qbang.org > From sspies at sloc.de Thu Apr 24 07:15:36 2008 From: sspies at sloc.de (Sebastian Spies) Date: Thu, 24 Apr 2008 15:15:36 +0200 (CEST) Subject: [Rxtx] rxtx on gumstix: Interrupted system call In-Reply-To: <47FB7B20.7080504@sloc.de> References: <47FB7B20.7080504@sloc.de> Message-ID: <55445.130.83.139.205.1209042936.squirrel@ssl.sloc.de> Dear list, while porting rxtx to the gumstix, I found out, that select used in readArray in SerialImp.c might not work as expected. Maybe, because of missing TIOCSERGETLSR-support? select is often interrupted, so i wrote the following quick'n'dirty hack to make it work on gumstix: diff -Nur rxtx-2.1-7r2/src/SerialImp.c rxtx-2.1-7r2/src/SerialImp.c --- rxtx-2.1-7r2/src/SerialImp.c 2006-01-29 23:19:04.000000000 +0100 +++ rxtx-2.1-7r2-patched/src/SerialImp.c 2008-04-24 14:30:17.000000000 +0200 @@ -3380,7 +3381,7 @@ JNIEXPORT jint JNICALL RXTXPort(readArray)( JNIEnv *env, jobject jobj, jbyteArray jbarray, jint offset, jint length ) { - int bytes; + int bytes = 0; jbyte *body; /* char msg[80]; */ int fd = get_java_var( env, jobj, "fd", "I" ); @@ -3397,9 +3398,18 @@ "readArray", "Invalid length" ); return -1; } - body = (*env)->GetByteArrayElements( env, jbarray, 0 ); - bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ - (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + while(1 > bytes) + { + body = (*env)->GetByteArrayElements( env, jbarray, 0 ); + bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ + (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + // quick'n'dirty - SSP + report (" trying again... \n"); + errno = 0; + } + if( bytes < 0 ) { report( "RXTXPort:readArray bytes < 0" ); LEAVE( "RXTXPort:readArray" ); > Hey, > > I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use > RXTXPort$SerialInputStream.read(), then I get the following Exception. I > did not yet figure out which system call is interrupted as strace > produces loads of output. > > Any help would be very appreciated. Thanks in advance. > Sebastian > > > [java] java.io.IOException: Interrupted system call in readArray > [java] at gnu.io.RXTXPort.readArray(Native Method) > [java] at > gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) > [java] at > java.io.FilterInputStream.read(FilterInputStream.java:189) > [java] at > java.io.BufferedInputStream.refill(BufferedInputStream.java:371) > [java] at > java.io.BufferedInputStream.read(BufferedInputStream.java:229) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) > [java] at > com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) > > -- > Sebastian Spies > > mail: sspies at sloc.de > > > > From fire_baptized at hotmail.com Thu Apr 24 18:27:48 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Thu, 24 Apr 2008 20:27:48 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hello I am having a problem with the serial device connecting (software wise) to the serial port. However I have a test program and it seems to work just fine in that environment - and it doesnt use GUI. The error I am getting is : PortNotFoundException Now the way I have it setup in the GUI environment is that once the user pushes a JButton the program connects using this class: protected void establishConnection() { try { portId = CommPortIdentifier.getPortIdentifier("COM3"); System.out.println("Establishing connction....."); messages[0] = "\nEstablishing connction.....\n"; } catch ( NoSuchPortException noport) { System.out.println("Port not found: "+ noport); messages[0] = "Port not found: "+ noport+"\n"; } try { serialPort = (SerialPort) portId.open("serial", 50); System.out.println("Port has been found."); messages[1] = "Port has been found.\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[1] = "" +usedport; } try { serialPort = (SerialPort) portId.open("serial", 50); messages[2] = "Connecting to COM3 on port 50....\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; } try { serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); System.out.println("Esablishing the transfer rate settings for COM3."); messages[3] = "Esablishing the transfer rate settings for COM3.\n"; } catch (UnsupportedCommOperationException nosupcom) { System.out.println(nosupcom); System.out.println("The tranfer rate could not be esblished on COM3."); messages[3] = "The tranfer rate could not be esblished on COM3.\n"; } System.out.println(serialPort.getFlowControlMode()); messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; //sendDataOut(buffer[3],buffer[4]); } I need all the data in this method (and all the string values in this method) to be printed out on a JTextArea. I wont do me any good if not all the text is printed on a JTextArea in another class. So I have the text printing the JTextArea correctly, but everytime the JButton is activated - it gives me that error message. I did add a disconnect button that is supposed to call the serialPort.close(). _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/273fd4ec/attachment-0041.html From tjarvi at qbang.org Thu Apr 24 21:54:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Apr 2008 21:54:10 -0600 (MDT) Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > Hello I am having a problem with the serial device connecting (software > wise) to the serial port. However I have a test program and it seems to > work just fine in that environment - and it doesnt use GUI. The error I > am getting is : PortNotFoundException Now the way I have it setup in the > GUI environment is that once the user pushes a JButton the program > connects using this class: > > protected void establishConnection() { > try { > portId = CommPortIdentifier.getPortIdentifier("COM3"); > System.out.println("Establishing connction....."); > messages[0] = "\nEstablishing connction.....\n"; > } > catch ( NoSuchPortException noport) { > System.out.println("Port not found: "+ noport); > messages[0] = "Port not found: "+ noport+"\n"; > } > try { > serialPort = (SerialPort) portId.open("serial", 50); > System.out.println("Port has been found."); > messages[1] = "Port has been found.\n"; > } > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[1] = "" +usedport; > } ================================================================= > try { > serialPort = (SerialPort) portId.open("serial", 50); > messages[2] = "Connecting to COM3 on port 50....\n"; > } ================================================================== > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > } > try { > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > System.out.println("Esablishing the transfer rate settings for COM3."); > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > } > catch (UnsupportedCommOperationException nosupcom) { > System.out.println(nosupcom); > System.out.println("The tranfer rate could not be esblished on COM3."); > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > } > System.out.println(serialPort.getFlowControlMode()); > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > //sendDataOut(buffer[3],buffer[4]); > } > > I need all the data in this method (and all the string values in this > method) to be printed out on a JTextArea. I wont do me any good if not > all the text is printed on a JTextArea in another class. So I have the > text printing the JTextArea correctly, but everytime the JButton is > activated - it gives me that error message. I did add a disconnect > button that is supposed to call the serialPort.close(). > The open code used twice is going to throw an exception. It may be that you catch the exception above this code and print a confusing message? A common mistake is people will accidently run two copies of their program. The first instance of the program will open the port and prevent enumeration (finding the port) in the second instance of the program. As an example, you may be running your text based application which is preventing the GUI from seeing the port. Enumeration is done by trying to open the port. If the port is open, Enumeration fails. -- Trent Jarvi tjarvi at qbang.org From fire_baptized at hotmail.com Thu Apr 24 22:32:05 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 00:32:05 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Wow - thanks dude what a dumb thing for me to not catch..... now here is the current problem - right now I am trying to output data again one is with the test program - and it seems that serialPort.setRTS(true); is throwing an exceptions there - now if I show this code please bare in mind that I am only testing - the code is kinda sloppy in my mind - but if I can figure out why calling this function is throwing an exception then maybe I can figure out why my GUI application is getting the same null pointer exceptions when try to send out the data stream. FYI Trent this email is not directed towards you - anyone can jump in on this public static void main(String args[]) { byte[] b = new byte[64]; int keyinput = 0 ; byte x = 0; byte y = 0; PortTesting1 testports = new PortTesting1(); try { joyskoro = Joystick.createInstance(); } catch (IOException ioexc) { System.out.println("There is an input/output problem: " + ioexc); } while (true) { joyskoro.poll(); b[0] = ((byte) -(10 * joyskoro.getY())); b[1] = ((byte) (10 * joyskoro.getX())); System.out.println("The 3rd byte is: " +b[0]); System.out.println("The 4rd byte is: " +b[1]); serialPort.setRTS(true); // HERE IS WHERE THE PROBLEM IS !!!!!!! ON THIS LINE but if I dont have it active in my program the Bluetooth device (that is System.out.println("Ready to send :-) !"); //connected to the serial port does not send out data!!!!! if (joyskoro.isButtonDown(joyskoro.BUTTON10)) { System.out.println("Connection terminated."); serialPort.close(); break; } if (joyskoro.isButtonDown(joyskoro.BUTTON2)) { boolean flag = true; //reading from key input from the keyboard System.out.println("Please input a command: "); while (flag) { try { keyinput = System.in.read(); } catch (IOException ioexc) {/*there is no need to put * anything here */ } if((char)keyinput=='w') { pushIt((byte)85); } if((char)keyinput=='s') { pushIt((byte)84); } if((char)keyinput=='a') { pushIt((byte)83); } if((char)keyinput=='d') { pushIt((byte)82); } if((char)keyinput=='q') { pushIt((byte)89); } if((char)keyinput=='\t') { //this stop reading input from the keyboard flag = false; } } and help anyways here is the block of code that throwing an exception for the test program: > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/5c8f7d68/attachment-0041.html From fire_baptized at hotmail.com Fri Apr 25 07:59:53 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 09:59:53 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Are there any examples of how to push out data? As in using input and output streams - if I can compare code maybe I can see where this is causing a problem. I have a byte array that I am pushing out data. I keep getting null pointer exceptions every where I turn. > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/22228ab6/attachment-0040.html From ajmas at sympatico.ca Sat Apr 26 07:37:09 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 26 Apr 2008 09:37:09 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hi, On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote: > > Are there any examples of how to push out data? As in using input > and output streams - if I can compare code maybe I can see where > this is causing a problem. I have a byte array that I am pushing > out data. I keep getting null pointer exceptions every where I turn. > There are some examples here that might be of help: http://rxtx.qbang.org/wiki/index.php/Examples Andre From fire_baptized at hotmail.com Sat Apr 26 20:13:54 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Sat, 26 Apr 2008 22:13:54 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: looked at those....yep didnt help - I need to push out data with GUI and not get a null pointer exception everytime I try. > CC: rxtx at qbang.org> From: ajmas at sympatico.ca> To: fire_baptized at hotmail.com> Subject: Re: [Rxtx] Serial Problems with Gui.....> Date: Sat, 26 Apr 2008 09:37:09 -0400> > Hi,> > > On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote:> >> > Are there any examples of how to push out data? As in using input > > and output streams - if I can compare code maybe I can see where > > this is causing a problem. I have a byte array that I am pushing > > out data. I keep getting null pointer exceptions every where I turn.> >> > There are some examples here that might be of help:> > http://rxtx.qbang.org/wiki/index.php/Examples> > Andre _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080426/09f95b41/attachment-0039.html From michael.erskine at ketech.com Mon Apr 28 02:47:22 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 28 Apr 2008 09:47:22 +0100 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D426EF3CBBC5@no-sv-03.ketech.local> Jesrael D. Summerhill wrote: > looked at those....yep didnt help - I need to push out data with GUI and > not get a null pointer exception everytime I try. So it seems pretty obvious that your code needs to check for nulls wherever one may occur and report what's happening. Alternatively, catch the npe and display the stack trace. Then you can fix your code so it doesn't try to work with something that ain't there. Regards, Michael Erskine. From scldad at sdc.com.au Mon Apr 28 03:58:34 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Mon, 28 Apr 2008 19:28:34 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Message-ID: <200804281928.34454.scldad@sdc.com.au> Has anybody done any design work on this? The first thing that springs to mind is that we still need to check for lock files because other apps tend to use that approach even if we go to ioctl. Cheers, Stephen Davies On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > Thanks Trent. > > Problem is only that I'm really not at all > Familiar with the C part of RXTX. If there > Were anything I could do in Java for this, > It would be easier for me.... > > ... Are there any C experts here on the list > Who'd like to look at ioctl port locking > For linux? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > -----Original Message----- > > From: Trent Jarvi [mailto:tjarvi at qbang.org] > > Sent: Donnerstag, 24. April 2008 04:32 > > To: Oberhuber, Martin > > Cc: rxtx at qbang.org > > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > > > I'm wondering what the status is with RXTX locking > > > serial ports on Linux? > > > > > > My understanding is that the mechanism used in > > > 2.1-7r2 (lockfiles) is not really state of the art, and > > > has lots of problems (e.g. missing permissions). > > > > > > There was an idea to migrate towards a Kernel > > > syscall based solution for port locking. > > > > > > What's the status here? > > > > Hi Martin, > > > > I'm in favor of deprecating the current FHS locking mechanism > > in favor of > > an IOCTL when available. I think it will be available on all the > > platforms but do not know for sure. > > > > The status is unchanged. I've had very few free cycles for > > such things. > > Feel free to take a stab at it if you have some time. I > > believe the IOCTL > > is used in the Mac OS X code already. > > > > I don't see any real backwards compatability issues and the > > IOCTL should > > just work. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Mon Apr 28 04:21:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 28 Apr 2008 04:21:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804281928.34454.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: I don't think there would need to be any architectural changes. A couple ifdefs and minor changes in the current code should be enough. Proposal: FHS/UUCP locks: continue to respect them, try to create them but do not error if the IOCTL is supported. (But does the IOCTL being defined mean it will work?) Enumeration: Do not assert the IOCTL while opening. Serial.open: assert the IOCTL after open. Continue to use locks as described above after asserting the IOCTL. If the IOCTL is defined but not working, handle it here. Failure cases include the IOCTL is not supported and the port is already locked. On Mon, 28 Apr 2008, Stephen Davies wrote: > Has anybody done any design work on this? > The first thing that springs to mind is that we still need to check for lock > files because other apps tend to use that approach even if we go to ioctl. > > Cheers, > Stephen Davies > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: >> Thanks Trent. >> >> Problem is only that I'm really not at all >> Familiar with the C part of RXTX. If there >> Were anything I could do in Java for this, >> It would be easier for me.... >> >> ... Are there any C experts here on the list >> Who'd like to look at ioctl port locking >> For linux? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >>> -----Original Message----- >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] >>> Sent: Donnerstag, 24. April 2008 04:32 >>> To: Oberhuber, Martin >>> Cc: rxtx at qbang.org >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? >>> >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: >>>> Dear RXTX community, >>>> >>>> I'm wondering what the status is with RXTX locking >>>> serial ports on Linux? >>>> >>>> My understanding is that the mechanism used in >>>> 2.1-7r2 (lockfiles) is not really state of the art, and >>>> has lots of problems (e.g. missing permissions). >>>> >>>> There was an idea to migrate towards a Kernel >>>> syscall based solution for port locking. >>>> >>>> What's the status here? >>> >>> Hi Martin, >>> >>> I'm in favor of deprecating the current FHS locking mechanism >>> in favor of >>> an IOCTL when available. I think it will be available on all the >>> platforms but do not know for sure. >>> >>> The status is unchanged. I've had very few free cycles for >>> such things. >>> Feel free to take a stab at it if you have some time. I >>> believe the IOCTL >>> is used in the Mac OS X code already. >>> >>> I don't see any real backwards compatability issues and the >>> IOCTL should >>> just work. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Tue Apr 29 12:04:04 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Apr 2008 20:04:04 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Hi all, The biggest problem that I have seen with lockfiles on Linux At least is, that it seems there is no standard with respect To the folder in which they should be created. Also, many Distributions seem to set up file system permissions in such A way that writing to the lockfile folder is not allowed for The normal user -- that's why we stopped using lockfiles In our commercial product. If we are to still respect lockfiles, we first need to Understand where we are expected to look for them. Does Anybody have any insight what variants of lockfile folder Schema exist out there in the wild? Some apps like minicom Seem to even allow users to manually specify a lockfile Folder of their choice. Because of the difficulty finding the right lockfile folder, And because of the inherent risk of thinking that something Might be locked while it actually isn't, I'd suggest that RXTX should have a "soft-off" feature that allows disabling ALL Lockfile checks at runtime without recompiling the native Sharedlibs. Trent - I like your strategy outline, but I think that it Needs to be configurable by the client such that users and/or Customer Support can disable lockfiles / disable ioctl in Case they detect that they are runing on an OS / Kernal that Does not support one or the other. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Montag, 28. April 2008 12:22 > To: Stephen Davies > Cc: rxtx at qbang.org; Oberhuber, Martin; Trent Jarvi > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > I don't think there would need to be any architectural > changes. A couple > ifdefs and minor changes in the current code should be enough. > > Proposal: > > FHS/UUCP locks: > continue to respect them, try to create them but do not error if > the IOCTL is supported. (But does the IOCTL being defined mean > it will work?) > Enumeration: > Do not assert the IOCTL while opening. > Serial.open: > assert the IOCTL after open. Continue to use locks as described > above after asserting the IOCTL. If the IOCTL is defined but > not working, handle it here. Failure cases include the IOCTL > is not supported and the port is already locked. > > On Mon, 28 Apr 2008, Stephen Davies wrote: > > > Has anybody done any design work on this? > > The first thing that springs to mind is that we still need > to check for lock > > files because other apps tend to use that approach even if > we go to ioctl. > > > > Cheers, > > Stephen Davies > > > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > >> Thanks Trent. > >> > >> Problem is only that I'm really not at all > >> Familiar with the C part of RXTX. If there > >> Were anything I could do in Java for this, > >> It would be easier for me.... > >> > >> ... Are there any C experts here on the list > >> Who'd like to look at ioctl port locking > >> For linux? > >> > >> Thanks, > >> -- > >> Martin Oberhuber, Senior Member of Technical Staff, Wind River > >> Target Management Project Lead, DSDP PMC Member > >> http://www.eclipse.org/dsdp/tm > >> > >>> -----Original Message----- > >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] > >>> Sent: Donnerstag, 24. April 2008 04:32 > >>> To: Oberhuber, Martin > >>> Cc: rxtx at qbang.org > >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? > >>> > >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > >>>> Dear RXTX community, > >>>> > >>>> I'm wondering what the status is with RXTX locking > >>>> serial ports on Linux? > >>>> > >>>> My understanding is that the mechanism used in > >>>> 2.1-7r2 (lockfiles) is not really state of the art, and > >>>> has lots of problems (e.g. missing permissions). > >>>> > >>>> There was an idea to migrate towards a Kernel > >>>> syscall based solution for port locking. > >>>> > >>>> What's the status here? > >>> > >>> Hi Martin, > >>> > >>> I'm in favor of deprecating the current FHS locking mechanism > >>> in favor of > >>> an IOCTL when available. I think it will be available on all the > >>> platforms but do not know for sure. > >>> > >>> The status is unchanged. I've had very few free cycles for > >>> such things. > >>> Feel free to take a stab at it if you have some time. I > >>> believe the IOCTL > >>> is used in the Mac OS X code already. > >>> > >>> I don't see any real backwards compatability issues and the > >>> IOCTL should > >>> just work. > >>> > >>> -- > >>> Trent Jarvi > >>> tjarvi at qbang.org > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > From Steffen.DETTMER at ingenico.com Tue Apr 29 13:34:44 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 29 Apr 2008 21:34:44 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Message-ID: <20080429193444.GU2928@elberon.bln.de.ingenico.com> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > The biggest problem that I have seen with lockfiles on Linux > At least is, that it seems there is no standard with respect > To the folder in which they should be created. Also, many > Distributions seem to set up file system permissions in such > A way that writing to the lockfile folder is not allowed for > The normal user -- that's why we stopped using lockfiles > In our commercial product. It seems it depends on the expectations. I consider it as a feature that by default a linux user cannot access serial ports. Maybe root connected a modem (can produce phone bills) or even some serial card reader, maybe with the web servers key pair. I would expect that by default a user cannot open the serial port because of insufficient permissions on the device file. I would expect this on other unices as well (but I don't know it). For windows I think it should be similar but not impacting so much in practice, because often windows users work with big permissions on a somewhat high priviledge level or even Administrator. > If we are to still respect lockfiles, we first need to > Understand where we are expected to look for them. Does > Anybody have any insight what variants of lockfile folder > Schema exist out there in the wild? Some apps like minicom > Seem to even allow users to manually specify a lockfile > Folder of their choice. At least my (ancient) minicom does not allow the user to change this option, it is displayed but read-only, but root is allowed to change it. > Because of the difficulty finding the right lockfile folder, > And because of the inherent risk of thinking that something > Might be locked while it actually isn't, I'd suggest that > RXTX should have a "soft-off" feature that allows disabling > ALL Lockfile checks at runtime without recompiling the native > Sharedlibs. sounds very reasonable, yes... and as admin I would not wish that users could skip such locking because they do things wrong by default ;) (in the end I guess that is related to the dilemma, that hotplug/user-owned-periphery and multi-user systems simply conflict) > Trent - I like your strategy outline, but I think that it > Needs to be configurable by the client such that users and/or > Customer Support can disable lockfiles / disable ioctl in > Case they detect that they are runing on an OS / Kernal that > Does not support one or the other. Yes, this would be good I guess... Applications could offer configuration options to control that, maybe similarily as minicom. BTW, man minicom tells: *B - Lock file location On most systems This should be /usr/spool/uucp. Linux systems use /var/lock. If this directory does not exist, minicom will not attempt to use lockfiles. The statement `Linux systems use /var/lock' is interesting, does anyone know the source of this convention? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Tue Apr 29 16:11:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Apr 2008 16:11:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? These details are outlined in the Filesystem Hierarchy Standard (FHS). http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLOCKLOCKFILES -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Tue Apr 29 18:58:09 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Wed, 30 Apr 2008 10:28:09 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: <200804301028.09307.scldad@sdc.com.au> I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is the same. Any ideas as to how to handle this? Stephen On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: > * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > > The biggest problem that I have seen with lockfiles on Linux > > At least is, that it seems there is no standard with respect > > To the folder in which they should be created. Also, many > > Distributions seem to set up file system permissions in such > > A way that writing to the lockfile folder is not allowed for > > The normal user -- that's why we stopped using lockfiles > > In our commercial product. > > It seems it depends on the expectations. I consider it as a > feature that by default a linux user cannot access serial ports. > Maybe root connected a modem (can produce phone bills) or even > some serial card reader, maybe with the web servers key pair. > > I would expect that by default a user cannot open the serial port > because of insufficient permissions on the device file. I would > expect this on other unices as well (but I don't know it). > > For windows I think it should be similar but not impacting so > much in practice, because often windows users work with big > permissions on a somewhat high priviledge level or even > Administrator. > > > If we are to still respect lockfiles, we first need to > > Understand where we are expected to look for them. Does > > Anybody have any insight what variants of lockfile folder > > Schema exist out there in the wild? Some apps like minicom > > Seem to even allow users to manually specify a lockfile > > Folder of their choice. > > At least my (ancient) minicom does not allow the user to change > this option, it is displayed but read-only, but root is allowed > to change it. > > > Because of the difficulty finding the right lockfile folder, > > And because of the inherent risk of thinking that something > > Might be locked while it actually isn't, I'd suggest that > > RXTX should have a "soft-off" feature that allows disabling > > ALL Lockfile checks at runtime without recompiling the native > > Sharedlibs. > > sounds very reasonable, yes... > and as admin I would not wish that users could skip such > locking because they do things wrong by default ;) > > (in the end I guess that is related to the dilemma, that > hotplug/user-owned-periphery and multi-user systems simply > conflict) > > > Trent - I like your strategy outline, but I think that it > > Needs to be configurable by the client such that users and/or > > Customer Support can disable lockfiles / disable ioctl in > > Case they detect that they are runing on an OS / Kernal that > > Does not support one or the other. > > Yes, this would be good I guess... Applications could offer > configuration options to control that, maybe similarily as > minicom. > > BTW, man minicom tells: > > *B - Lock file location > On most systems This should be /usr/spool/uucp. > Linux systems use /var/lock. If this directory > does not exist, minicom will not attempt to use > lockfiles. > > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure > and expedient electronic transaction acceptance. Ingenico products leverage > proven technology, established standards and unparalleled ergonomics to > provide optimal reliability, versatility and usability. This comprehensive > range of products is complemented by a global array of services and > partnerships, enabling businesses in a number of vertical sectors to accept > transactions anywhere their business takes them. www.ingenico.com This > message may contain confidential and/or privileged information. If you are > not the addressee or authorized to receive this for the addressee, you must > not use, copy, disclose or take any action based on this message or any > information herein. If you have received this message in error, please > advise the sender immediately by reply e-mail and delete this message. > Thank you for your cooperation. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Wed Apr 30 19:30:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 30 Apr 2008 19:30:51 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804301028.09307.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> <200804301028.09307.scldad@sdc.com.au> Message-ID: Hi Stephen, I suspect ioctl/TIOCEXCL open/O_EXCL would do the job. Mac uses TIOCEXCL and it is POSIX. We use O_EXCL for lockfiles on Linux already. On Wed, 30 Apr 2008, Stephen Davies wrote: > I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is > the same. > > Any ideas as to how to handle this? > > Stephen > > > On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: >> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: >>> The biggest problem that I have seen with lockfiles on Linux >>> At least is, that it seems there is no standard with respect >>> To the folder in which they should be created. Also, many >>> Distributions seem to set up file system permissions in such >>> A way that writing to the lockfile folder is not allowed for >>> The normal user -- that's why we stopped using lockfiles >>> In our commercial product. >> >> It seems it depends on the expectations. I consider it as a >> feature that by default a linux user cannot access serial ports. >> Maybe root connected a modem (can produce phone bills) or even >> some serial card reader, maybe with the web servers key pair. >> >> I would expect that by default a user cannot open the serial port >> because of insufficient permissions on the device file. I would >> expect this on other unices as well (but I don't know it). >> >> For windows I think it should be similar but not impacting so >> much in practice, because often windows users work with big >> permissions on a somewhat high priviledge level or even >> Administrator. >> >>> If we are to still respect lockfiles, we first need to >>> Understand where we are expected to look for them. Does >>> Anybody have any insight what variants of lockfile folder >>> Schema exist out there in the wild? Some apps like minicom >>> Seem to even allow users to manually specify a lockfile >>> Folder of their choice. >> >> At least my (ancient) minicom does not allow the user to change >> this option, it is displayed but read-only, but root is allowed >> to change it. >> >>> Because of the difficulty finding the right lockfile folder, >>> And because of the inherent risk of thinking that something >>> Might be locked while it actually isn't, I'd suggest that >>> RXTX should have a "soft-off" feature that allows disabling >>> ALL Lockfile checks at runtime without recompiling the native >>> Sharedlibs. >> >> sounds very reasonable, yes... >> and as admin I would not wish that users could skip such >> locking because they do things wrong by default ;) >> >> (in the end I guess that is related to the dilemma, that >> hotplug/user-owned-periphery and multi-user systems simply >> conflict) >> >>> Trent - I like your strategy outline, but I think that it >>> Needs to be configurable by the client such that users and/or >>> Customer Support can disable lockfiles / disable ioctl in >>> Case they detect that they are runing on an OS / Kernal that >>> Does not support one or the other. >> >> Yes, this would be good I guess... Applications could offer >> configuration options to control that, maybe similarily as >> minicom. >> >> BTW, man minicom tells: >> >> *B - Lock file location >> On most systems This should be /usr/spool/uucp. >> Linux systems use /var/lock. If this directory >> does not exist, minicom will not attempt to use >> lockfiles. >> >> The statement `Linux systems use /var/lock' is interesting, does >> anyone know the source of this convention? >> >> oki, >> >> Steffen >> >> About Ingenico Throughout the world businesses rely on Ingenico for secure >> and expedient electronic transaction acceptance. Ingenico products leverage >> proven technology, established standards and unparalleled ergonomics to >> provide optimal reliability, versatility and usability. This comprehensive >> range of products is complemented by a global array of services and >> partnerships, enabling businesses in a number of vertical sectors to accept >> transactions anywhere their business takes them. www.ingenico.com This >> message may contain confidential and/or privileged information. If you are >> not the addressee or authorized to receive this for the addressee, you must >> not use, copy, disclose or take any action based on this message or any >> information herein. If you have received this message in error, please >> advise the sender immediately by reply e-mail and delete this message. >> Thank you for your cooperation. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0065.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0063.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0050.html From pboulton at pulsetracer.com Fri Apr 18 14:30:13 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Fri, 18 Apr 2008 13:30:13 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site Message-ID: <480904D5.1060307@pulsetracer.com> Hello, gentle serial porters. I have downloaded the zipped up binaries for use on Windows without Sun's CommAPI, but don't seem able to extract anything from the download. Go to main page, http://www.rxtx.org/ Click on Downloads I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) And I save it to disk. If I try and extract the files with WinZip, Winzip thinks the archive is corrupt. If I try using Windows Explorer, I am able to extract it into a single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than the original .zip. Any help would be much appreciated. Sincerely, Philip Boulton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080418/97d89793/attachment-0048.html From tjarvi at qbang.org Fri Apr 18 19:07:00 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 18 Apr 2008 19:07:00 -0600 (MDT) Subject: [Rxtx] Difficulty opening zip file at rxtx site In-Reply-To: <480904D5.1060307@pulsetracer.com> References: <480904D5.1060307@pulsetracer.com> Message-ID: On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org From pboulton at pulsetracer.com Sat Apr 19 12:46:26 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Sat, 19 Apr 2008 11:46:26 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site References: <480904D5.1060307@pulsetracer.com> Message-ID: <53DB7576450695419E09299104043761A78533@ZTGSERVER.ztg.local> I have been able to get my hands on the binaries, by going to the ftp directory /pub/rxtx at ftp.qbang.org,, and ftping the file rxtx-2.1-7-bins-r2.zip . This opens happily with Winzip, and extracts as the set of files that you describe below. I only experience the ill-formed archive problem by clicking the link on the rxtx.org Downloads page (http://rxtx.qbang.org/pub/rxtx/ rxtx-2.1-7-bins-r2.zip ). Not sure what to make of that. Philip Boulton ________________________________ From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Fri 4/18/2008 6:07 PM To: Philip Boulton Cc: rxtx at qbang.org Subject: Re: [Rxtx] Difficulty opening zip file at rxtx site On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080419/147923bb/attachment-0047.html From jlar310 at gmail.com Sat Apr 19 19:11:55 2008 From: jlar310 at gmail.com (Jeff Larsen) Date: Sat, 19 Apr 2008 20:11:55 -0500 Subject: [Rxtx] Moxa serial over Ethernet driver Message-ID: Hi all, I've been using javax.comm for years to communicate with a legacy radio data system. We want to migrate the java side of the system to a VMware Server virtual machine. We've had great success using Moxa DE-303 and 5610 serial over Ethernet appliances and virtual machines for running hylafax. The OS (Linux in this case) uses a kernel driver to communicate with the Moxa via a virtual serial port such as /dev/ttyr00. I want to do the same thing with javax.comm or gnu.io to connect to a virtual serial port. However I'm hitting road blocks everywhere. javax.comm for Linux sees the virtual port, but there are transmission errors. Tried Solaris too, but the Solaris Moxa drivers don't play nice with javax.comm because the driver uses /dev/pts/n instead of /dev/term/x. Next I tried RXTX on Linux, but I'm getting NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX on Solaris. Has anyone used RXTX with serial over Ethernet devices? Any hints on how to make it work? I know that I'm not completely off track because javax.comm does work with Moxa on a Windows platform, but that's just not an option for production deployment. -- Jeff From tjarvi at qbang.org Sat Apr 19 21:08:41 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 19 Apr 2008 21:08:41 -0600 (MDT) Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: yOn Sat, 19 Apr 2008, Jeff Larsen wrote: > Hi all, > > I've been using javax.comm for years to communicate with a legacy > radio data system. We want to migrate the java side of the system to a > VMware Server virtual machine. We've had great success using Moxa > DE-303 and 5610 serial over Ethernet appliances and virtual machines > for running hylafax. The OS (Linux in this case) uses a kernel driver > to communicate with the Moxa via a virtual serial port such as > /dev/ttyr00. > > I want to do the same thing with javax.comm or gnu.io to connect to a > virtual serial port. However I'm hitting road blocks everywhere. > javax.comm for Linux sees the virtual port, but there are transmission > errors. Tried Solaris too, but the Solaris Moxa drivers don't play > nice with javax.comm because the driver uses /dev/pts/n instead of > /dev/term/x. Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris. > > Has anyone used RXTX with serial over Ethernet devices? Any hints on > how to make it work? > > I know that I'm not completely off track because javax.comm does work > with Moxa on a Windows platform, but that's just not an option for > production deployment. > > Moxa should work under linux. There may be minor issues depending upon how complete the kernel driver is but I think it will work. One of the minor issues is /dev/ttyr00 is not enumerated. There are several work arounds documented with the source code and on the wiki. The easiest solution for testing purposes is to make a symbolic link from /dev/ttyr00 to a port that is enumerated such as /dev/ttyS129. You can later alter the rxtx source or use properties to change the enumerated ports. -- Trent Jarvi tjarvi at qbang.org From d.tonhofer at m-plify.com Sun Apr 20 03:33:30 2008 From: d.tonhofer at m-plify.com (David Tonhofer (M-PLIFY S.A.)) Date: Sun, 20 Apr 2008 11:33:30 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: <480B0DEA.5010908@m-plify.com> Jeff Larsen wrote: > Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris It might be that the Java side of RXTX does not recognize that portname. Trying modifying src/RXTXCommDriver.java as described in this case: http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card From ajmas at sympatico.ca Sun Apr 20 16:37:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Apr 2008 18:37:59 -0400 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <480B0DEA.5010908@m-plify.com> References: <480B0DEA.5010908@m-plify.com> Message-ID: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > Jeff Larsen wrote: >> Next I tried RXTX on Linux, but I'm getting >> NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX >> on Solaris > It might be that the Java side of RXTX does not recognize that > portname. > Trying modifying src/RXTXCommDriver.java as described in this case: > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card I wonder whether it would be worth allowing custom port prefixes as a system parameter? For example: gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" Andre From Martin.Oberhuber at windriver.com Tue Apr 22 12:34:36 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 22 Apr 2008 20:34:36 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> References: <480B0DEA.5010908@m-plify.com> <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE6485848056CD6CE@ism-mail03.corp.ad.wrs.com> Sounds like a great idea... I'm wondering how the "variable part" after the Prefixes could be specified though? What about allowing Regular Expression character Classes in the existing System Property for specifying ports: System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyS[0-9],ttyS[ABC],ttyUSB[0-9a-z]"); The set of allowed patterns would of course need to Be restricted compared to REGEX, because it must be A syntax that supports iterating over it. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Montag, 21. April 2008 00:38 > To: rxtx at qbang.org and Users > Subject: Re: [Rxtx] Moxa serial over Ethernet driver > > > On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > > Jeff Larsen wrote: > >> Next I tried RXTX on Linux, but I'm getting > >> NoSuchPortException connecting to /dev/ttyr00. I have yet > to try RXTX > >> on Solaris > > It might be that the Java side of RXTX does not recognize that > > portname. > > Trying modifying src/RXTXCommDriver.java as described in this case: > > > > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_ > SST-4P.2FLP_multiport_card > > I wonder whether it would be worth allowing custom port > prefixes as a > system parameter? For > example: > > gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Loi.TRAN at weatherford.com Tue Apr 22 13:10:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Tue, 22 Apr 2008 14:10:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled Message-ID: Hi, I'm currently using the Java RXTX API to interface to a serial port. The serial port is connected to a bridge board that communicates with our communications system running at 1.875 Mbps which is linked to an embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no flow control). I send a command to the embedded board through the serial-bridge board which then is relayed to the embedded board. The command sent asks the embedded board to dump a binary image. Here's where I'm hitting some problems. I've successfully done this is an integrated serial port from the laptop. The binary file that comes back is consistent on every attempt. When I use the application I've written to do the same thing with a USB-to-serial adapter, the image I get back is not the same as the image I receive through the USB-to-serial adapter is not consistent at all. A final thing is that when I use a terminal program to dump the binary image with the USB-serial adapter, the image is correct. Every time! What is the terminal program doing that's not being done in my application? My application is quite simple. Has anyone observed this behavior before? If you have, I'd like to know how you've gotten around this problem. Thanks, LT =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From tjarvi at qbang.org Tue Apr 22 21:11:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 22 Apr 2008 21:11:10 -0600 (MDT) Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org From Loi.TRAN at weatherford.com Wed Apr 23 08:35:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Wed, 23 Apr 2008 09:35:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: Thanks for all the responses. I finally tried something that worked consistently. I updated my Prolific driver and repeated my tests. It worked. If you're using the Prolific type USB-serial adapters, do no use the Prolific version 2.0.2.1 driver on Windows. Update it to the latest 2.0.2.8 version. Again, thanks for all the responses. LT -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Tuesday, April 22, 2008 10:11 PM To: TRAN, Loi X. Cc: rxtx at qbang.org Subject: Re: [Rxtx] Prolific USB - RXTX data mangled On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From Martin.Oberhuber at windriver.com Wed Apr 23 18:54:26 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 02:54:26 +0200 Subject: [Rxtx] RXTX port locking on Linux status? Message-ID: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Dear RXTX community, I'm wondering what the status is with RXTX locking serial ports on Linux? My understanding is that the mechanism used in 2.1-7r2 (lockfiles) is not really state of the art, and has lots of problems (e.g. missing permissions). There was an idea to migrate towards a Kernel syscall based solution for port locking. What's the status here? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/9878db9f/attachment-0043.html From tjarvi at qbang.org Wed Apr 23 20:32:24 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Apr 2008 20:32:24 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > Dear RXTX community, > > I'm wondering what the status is with RXTX locking > serial ports on Linux? > > My understanding is that the mechanism used in > 2.1-7r2 (lockfiles) is not really state of the art, and > has lots of problems (e.g. missing permissions). > > There was an idea to migrate towards a Kernel > syscall based solution for port locking. > > What's the status here? > Hi Martin, I'm in favor of deprecating the current FHS locking mechanism in favor of an IOCTL when available. I think it will be available on all the platforms but do not know for sure. The status is unchanged. I've had very few free cycles for such things. Feel free to take a stab at it if you have some time. I believe the IOCTL is used in the Mac OS X code already. I don't see any real backwards compatability issues and the IOCTL should just work. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Apr 24 06:14:06 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 14:14:06 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Thanks Trent. Problem is only that I'm really not at all Familiar with the C part of RXTX. If there Were anything I could do in Java for this, It would be easier for me.... ... Are there any C experts here on the list Who'd like to look at ioctl port locking For linux? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Donnerstag, 24. April 2008 04:32 > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > I'm wondering what the status is with RXTX locking > > serial ports on Linux? > > > > My understanding is that the mechanism used in > > 2.1-7r2 (lockfiles) is not really state of the art, and > > has lots of problems (e.g. missing permissions). > > > > There was an idea to migrate towards a Kernel > > syscall based solution for port locking. > > > > What's the status here? > > > > Hi Martin, > > I'm in favor of deprecating the current FHS locking mechanism > in favor of > an IOCTL when available. I think it will be available on all the > platforms but do not know for sure. > > The status is unchanged. I've had very few free cycles for > such things. > Feel free to take a stab at it if you have some time. I > believe the IOCTL > is used in the Mac OS X code already. > > I don't see any real backwards compatability issues and the > IOCTL should > just work. > > -- > Trent Jarvi > tjarvi at qbang.org > From sspies at sloc.de Thu Apr 24 07:15:36 2008 From: sspies at sloc.de (Sebastian Spies) Date: Thu, 24 Apr 2008 15:15:36 +0200 (CEST) Subject: [Rxtx] rxtx on gumstix: Interrupted system call In-Reply-To: <47FB7B20.7080504@sloc.de> References: <47FB7B20.7080504@sloc.de> Message-ID: <55445.130.83.139.205.1209042936.squirrel@ssl.sloc.de> Dear list, while porting rxtx to the gumstix, I found out, that select used in readArray in SerialImp.c might not work as expected. Maybe, because of missing TIOCSERGETLSR-support? select is often interrupted, so i wrote the following quick'n'dirty hack to make it work on gumstix: diff -Nur rxtx-2.1-7r2/src/SerialImp.c rxtx-2.1-7r2/src/SerialImp.c --- rxtx-2.1-7r2/src/SerialImp.c 2006-01-29 23:19:04.000000000 +0100 +++ rxtx-2.1-7r2-patched/src/SerialImp.c 2008-04-24 14:30:17.000000000 +0200 @@ -3380,7 +3381,7 @@ JNIEXPORT jint JNICALL RXTXPort(readArray)( JNIEnv *env, jobject jobj, jbyteArray jbarray, jint offset, jint length ) { - int bytes; + int bytes = 0; jbyte *body; /* char msg[80]; */ int fd = get_java_var( env, jobj, "fd", "I" ); @@ -3397,9 +3398,18 @@ "readArray", "Invalid length" ); return -1; } - body = (*env)->GetByteArrayElements( env, jbarray, 0 ); - bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ - (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + while(1 > bytes) + { + body = (*env)->GetByteArrayElements( env, jbarray, 0 ); + bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ + (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + // quick'n'dirty - SSP + report (" trying again... \n"); + errno = 0; + } + if( bytes < 0 ) { report( "RXTXPort:readArray bytes < 0" ); LEAVE( "RXTXPort:readArray" ); > Hey, > > I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use > RXTXPort$SerialInputStream.read(), then I get the following Exception. I > did not yet figure out which system call is interrupted as strace > produces loads of output. > > Any help would be very appreciated. Thanks in advance. > Sebastian > > > [java] java.io.IOException: Interrupted system call in readArray > [java] at gnu.io.RXTXPort.readArray(Native Method) > [java] at > gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) > [java] at > java.io.FilterInputStream.read(FilterInputStream.java:189) > [java] at > java.io.BufferedInputStream.refill(BufferedInputStream.java:371) > [java] at > java.io.BufferedInputStream.read(BufferedInputStream.java:229) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) > [java] at > com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) > > -- > Sebastian Spies > > mail: sspies at sloc.de > > > > From fire_baptized at hotmail.com Thu Apr 24 18:27:48 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Thu, 24 Apr 2008 20:27:48 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hello I am having a problem with the serial device connecting (software wise) to the serial port. However I have a test program and it seems to work just fine in that environment - and it doesnt use GUI. The error I am getting is : PortNotFoundException Now the way I have it setup in the GUI environment is that once the user pushes a JButton the program connects using this class: protected void establishConnection() { try { portId = CommPortIdentifier.getPortIdentifier("COM3"); System.out.println("Establishing connction....."); messages[0] = "\nEstablishing connction.....\n"; } catch ( NoSuchPortException noport) { System.out.println("Port not found: "+ noport); messages[0] = "Port not found: "+ noport+"\n"; } try { serialPort = (SerialPort) portId.open("serial", 50); System.out.println("Port has been found."); messages[1] = "Port has been found.\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[1] = "" +usedport; } try { serialPort = (SerialPort) portId.open("serial", 50); messages[2] = "Connecting to COM3 on port 50....\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; } try { serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); System.out.println("Esablishing the transfer rate settings for COM3."); messages[3] = "Esablishing the transfer rate settings for COM3.\n"; } catch (UnsupportedCommOperationException nosupcom) { System.out.println(nosupcom); System.out.println("The tranfer rate could not be esblished on COM3."); messages[3] = "The tranfer rate could not be esblished on COM3.\n"; } System.out.println(serialPort.getFlowControlMode()); messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; //sendDataOut(buffer[3],buffer[4]); } I need all the data in this method (and all the string values in this method) to be printed out on a JTextArea. I wont do me any good if not all the text is printed on a JTextArea in another class. So I have the text printing the JTextArea correctly, but everytime the JButton is activated - it gives me that error message. I did add a disconnect button that is supposed to call the serialPort.close(). _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/273fd4ec/attachment-0042.html From tjarvi at qbang.org Thu Apr 24 21:54:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Apr 2008 21:54:10 -0600 (MDT) Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > Hello I am having a problem with the serial device connecting (software > wise) to the serial port. However I have a test program and it seems to > work just fine in that environment - and it doesnt use GUI. The error I > am getting is : PortNotFoundException Now the way I have it setup in the > GUI environment is that once the user pushes a JButton the program > connects using this class: > > protected void establishConnection() { > try { > portId = CommPortIdentifier.getPortIdentifier("COM3"); > System.out.println("Establishing connction....."); > messages[0] = "\nEstablishing connction.....\n"; > } > catch ( NoSuchPortException noport) { > System.out.println("Port not found: "+ noport); > messages[0] = "Port not found: "+ noport+"\n"; > } > try { > serialPort = (SerialPort) portId.open("serial", 50); > System.out.println("Port has been found."); > messages[1] = "Port has been found.\n"; > } > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[1] = "" +usedport; > } ================================================================= > try { > serialPort = (SerialPort) portId.open("serial", 50); > messages[2] = "Connecting to COM3 on port 50....\n"; > } ================================================================== > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > } > try { > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > System.out.println("Esablishing the transfer rate settings for COM3."); > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > } > catch (UnsupportedCommOperationException nosupcom) { > System.out.println(nosupcom); > System.out.println("The tranfer rate could not be esblished on COM3."); > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > } > System.out.println(serialPort.getFlowControlMode()); > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > //sendDataOut(buffer[3],buffer[4]); > } > > I need all the data in this method (and all the string values in this > method) to be printed out on a JTextArea. I wont do me any good if not > all the text is printed on a JTextArea in another class. So I have the > text printing the JTextArea correctly, but everytime the JButton is > activated - it gives me that error message. I did add a disconnect > button that is supposed to call the serialPort.close(). > The open code used twice is going to throw an exception. It may be that you catch the exception above this code and print a confusing message? A common mistake is people will accidently run two copies of their program. The first instance of the program will open the port and prevent enumeration (finding the port) in the second instance of the program. As an example, you may be running your text based application which is preventing the GUI from seeing the port. Enumeration is done by trying to open the port. If the port is open, Enumeration fails. -- Trent Jarvi tjarvi at qbang.org From fire_baptized at hotmail.com Thu Apr 24 22:32:05 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 00:32:05 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Wow - thanks dude what a dumb thing for me to not catch..... now here is the current problem - right now I am trying to output data again one is with the test program - and it seems that serialPort.setRTS(true); is throwing an exceptions there - now if I show this code please bare in mind that I am only testing - the code is kinda sloppy in my mind - but if I can figure out why calling this function is throwing an exception then maybe I can figure out why my GUI application is getting the same null pointer exceptions when try to send out the data stream. FYI Trent this email is not directed towards you - anyone can jump in on this public static void main(String args[]) { byte[] b = new byte[64]; int keyinput = 0 ; byte x = 0; byte y = 0; PortTesting1 testports = new PortTesting1(); try { joyskoro = Joystick.createInstance(); } catch (IOException ioexc) { System.out.println("There is an input/output problem: " + ioexc); } while (true) { joyskoro.poll(); b[0] = ((byte) -(10 * joyskoro.getY())); b[1] = ((byte) (10 * joyskoro.getX())); System.out.println("The 3rd byte is: " +b[0]); System.out.println("The 4rd byte is: " +b[1]); serialPort.setRTS(true); // HERE IS WHERE THE PROBLEM IS !!!!!!! ON THIS LINE but if I dont have it active in my program the Bluetooth device (that is System.out.println("Ready to send :-) !"); //connected to the serial port does not send out data!!!!! if (joyskoro.isButtonDown(joyskoro.BUTTON10)) { System.out.println("Connection terminated."); serialPort.close(); break; } if (joyskoro.isButtonDown(joyskoro.BUTTON2)) { boolean flag = true; //reading from key input from the keyboard System.out.println("Please input a command: "); while (flag) { try { keyinput = System.in.read(); } catch (IOException ioexc) {/*there is no need to put * anything here */ } if((char)keyinput=='w') { pushIt((byte)85); } if((char)keyinput=='s') { pushIt((byte)84); } if((char)keyinput=='a') { pushIt((byte)83); } if((char)keyinput=='d') { pushIt((byte)82); } if((char)keyinput=='q') { pushIt((byte)89); } if((char)keyinput=='\t') { //this stop reading input from the keyboard flag = false; } } and help anyways here is the block of code that throwing an exception for the test program: > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/5c8f7d68/attachment-0042.html From fire_baptized at hotmail.com Fri Apr 25 07:59:53 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 09:59:53 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Are there any examples of how to push out data? As in using input and output streams - if I can compare code maybe I can see where this is causing a problem. I have a byte array that I am pushing out data. I keep getting null pointer exceptions every where I turn. > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/22228ab6/attachment-0041.html From ajmas at sympatico.ca Sat Apr 26 07:37:09 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 26 Apr 2008 09:37:09 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hi, On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote: > > Are there any examples of how to push out data? As in using input > and output streams - if I can compare code maybe I can see where > this is causing a problem. I have a byte array that I am pushing > out data. I keep getting null pointer exceptions every where I turn. > There are some examples here that might be of help: http://rxtx.qbang.org/wiki/index.php/Examples Andre From fire_baptized at hotmail.com Sat Apr 26 20:13:54 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Sat, 26 Apr 2008 22:13:54 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: looked at those....yep didnt help - I need to push out data with GUI and not get a null pointer exception everytime I try. > CC: rxtx at qbang.org> From: ajmas at sympatico.ca> To: fire_baptized at hotmail.com> Subject: Re: [Rxtx] Serial Problems with Gui.....> Date: Sat, 26 Apr 2008 09:37:09 -0400> > Hi,> > > On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote:> >> > Are there any examples of how to push out data? As in using input > > and output streams - if I can compare code maybe I can see where > > this is causing a problem. I have a byte array that I am pushing > > out data. I keep getting null pointer exceptions every where I turn.> >> > There are some examples here that might be of help:> > http://rxtx.qbang.org/wiki/index.php/Examples> > Andre _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080426/09f95b41/attachment-0040.html From michael.erskine at ketech.com Mon Apr 28 02:47:22 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 28 Apr 2008 09:47:22 +0100 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D426EF3CBBC5@no-sv-03.ketech.local> Jesrael D. Summerhill wrote: > looked at those....yep didnt help - I need to push out data with GUI and > not get a null pointer exception everytime I try. So it seems pretty obvious that your code needs to check for nulls wherever one may occur and report what's happening. Alternatively, catch the npe and display the stack trace. Then you can fix your code so it doesn't try to work with something that ain't there. Regards, Michael Erskine. From scldad at sdc.com.au Mon Apr 28 03:58:34 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Mon, 28 Apr 2008 19:28:34 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Message-ID: <200804281928.34454.scldad@sdc.com.au> Has anybody done any design work on this? The first thing that springs to mind is that we still need to check for lock files because other apps tend to use that approach even if we go to ioctl. Cheers, Stephen Davies On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > Thanks Trent. > > Problem is only that I'm really not at all > Familiar with the C part of RXTX. If there > Were anything I could do in Java for this, > It would be easier for me.... > > ... Are there any C experts here on the list > Who'd like to look at ioctl port locking > For linux? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > -----Original Message----- > > From: Trent Jarvi [mailto:tjarvi at qbang.org] > > Sent: Donnerstag, 24. April 2008 04:32 > > To: Oberhuber, Martin > > Cc: rxtx at qbang.org > > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > > > I'm wondering what the status is with RXTX locking > > > serial ports on Linux? > > > > > > My understanding is that the mechanism used in > > > 2.1-7r2 (lockfiles) is not really state of the art, and > > > has lots of problems (e.g. missing permissions). > > > > > > There was an idea to migrate towards a Kernel > > > syscall based solution for port locking. > > > > > > What's the status here? > > > > Hi Martin, > > > > I'm in favor of deprecating the current FHS locking mechanism > > in favor of > > an IOCTL when available. I think it will be available on all the > > platforms but do not know for sure. > > > > The status is unchanged. I've had very few free cycles for > > such things. > > Feel free to take a stab at it if you have some time. I > > believe the IOCTL > > is used in the Mac OS X code already. > > > > I don't see any real backwards compatability issues and the > > IOCTL should > > just work. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Mon Apr 28 04:21:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 28 Apr 2008 04:21:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804281928.34454.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: I don't think there would need to be any architectural changes. A couple ifdefs and minor changes in the current code should be enough. Proposal: FHS/UUCP locks: continue to respect them, try to create them but do not error if the IOCTL is supported. (But does the IOCTL being defined mean it will work?) Enumeration: Do not assert the IOCTL while opening. Serial.open: assert the IOCTL after open. Continue to use locks as described above after asserting the IOCTL. If the IOCTL is defined but not working, handle it here. Failure cases include the IOCTL is not supported and the port is already locked. On Mon, 28 Apr 2008, Stephen Davies wrote: > Has anybody done any design work on this? > The first thing that springs to mind is that we still need to check for lock > files because other apps tend to use that approach even if we go to ioctl. > > Cheers, > Stephen Davies > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: >> Thanks Trent. >> >> Problem is only that I'm really not at all >> Familiar with the C part of RXTX. If there >> Were anything I could do in Java for this, >> It would be easier for me.... >> >> ... Are there any C experts here on the list >> Who'd like to look at ioctl port locking >> For linux? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >>> -----Original Message----- >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] >>> Sent: Donnerstag, 24. April 2008 04:32 >>> To: Oberhuber, Martin >>> Cc: rxtx at qbang.org >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? >>> >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: >>>> Dear RXTX community, >>>> >>>> I'm wondering what the status is with RXTX locking >>>> serial ports on Linux? >>>> >>>> My understanding is that the mechanism used in >>>> 2.1-7r2 (lockfiles) is not really state of the art, and >>>> has lots of problems (e.g. missing permissions). >>>> >>>> There was an idea to migrate towards a Kernel >>>> syscall based solution for port locking. >>>> >>>> What's the status here? >>> >>> Hi Martin, >>> >>> I'm in favor of deprecating the current FHS locking mechanism >>> in favor of >>> an IOCTL when available. I think it will be available on all the >>> platforms but do not know for sure. >>> >>> The status is unchanged. I've had very few free cycles for >>> such things. >>> Feel free to take a stab at it if you have some time. I >>> believe the IOCTL >>> is used in the Mac OS X code already. >>> >>> I don't see any real backwards compatability issues and the >>> IOCTL should >>> just work. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Tue Apr 29 12:04:04 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Apr 2008 20:04:04 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Hi all, The biggest problem that I have seen with lockfiles on Linux At least is, that it seems there is no standard with respect To the folder in which they should be created. Also, many Distributions seem to set up file system permissions in such A way that writing to the lockfile folder is not allowed for The normal user -- that's why we stopped using lockfiles In our commercial product. If we are to still respect lockfiles, we first need to Understand where we are expected to look for them. Does Anybody have any insight what variants of lockfile folder Schema exist out there in the wild? Some apps like minicom Seem to even allow users to manually specify a lockfile Folder of their choice. Because of the difficulty finding the right lockfile folder, And because of the inherent risk of thinking that something Might be locked while it actually isn't, I'd suggest that RXTX should have a "soft-off" feature that allows disabling ALL Lockfile checks at runtime without recompiling the native Sharedlibs. Trent - I like your strategy outline, but I think that it Needs to be configurable by the client such that users and/or Customer Support can disable lockfiles / disable ioctl in Case they detect that they are runing on an OS / Kernal that Does not support one or the other. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Montag, 28. April 2008 12:22 > To: Stephen Davies > Cc: rxtx at qbang.org; Oberhuber, Martin; Trent Jarvi > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > I don't think there would need to be any architectural > changes. A couple > ifdefs and minor changes in the current code should be enough. > > Proposal: > > FHS/UUCP locks: > continue to respect them, try to create them but do not error if > the IOCTL is supported. (But does the IOCTL being defined mean > it will work?) > Enumeration: > Do not assert the IOCTL while opening. > Serial.open: > assert the IOCTL after open. Continue to use locks as described > above after asserting the IOCTL. If the IOCTL is defined but > not working, handle it here. Failure cases include the IOCTL > is not supported and the port is already locked. > > On Mon, 28 Apr 2008, Stephen Davies wrote: > > > Has anybody done any design work on this? > > The first thing that springs to mind is that we still need > to check for lock > > files because other apps tend to use that approach even if > we go to ioctl. > > > > Cheers, > > Stephen Davies > > > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > >> Thanks Trent. > >> > >> Problem is only that I'm really not at all > >> Familiar with the C part of RXTX. If there > >> Were anything I could do in Java for this, > >> It would be easier for me.... > >> > >> ... Are there any C experts here on the list > >> Who'd like to look at ioctl port locking > >> For linux? > >> > >> Thanks, > >> -- > >> Martin Oberhuber, Senior Member of Technical Staff, Wind River > >> Target Management Project Lead, DSDP PMC Member > >> http://www.eclipse.org/dsdp/tm > >> > >>> -----Original Message----- > >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] > >>> Sent: Donnerstag, 24. April 2008 04:32 > >>> To: Oberhuber, Martin > >>> Cc: rxtx at qbang.org > >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? > >>> > >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > >>>> Dear RXTX community, > >>>> > >>>> I'm wondering what the status is with RXTX locking > >>>> serial ports on Linux? > >>>> > >>>> My understanding is that the mechanism used in > >>>> 2.1-7r2 (lockfiles) is not really state of the art, and > >>>> has lots of problems (e.g. missing permissions). > >>>> > >>>> There was an idea to migrate towards a Kernel > >>>> syscall based solution for port locking. > >>>> > >>>> What's the status here? > >>> > >>> Hi Martin, > >>> > >>> I'm in favor of deprecating the current FHS locking mechanism > >>> in favor of > >>> an IOCTL when available. I think it will be available on all the > >>> platforms but do not know for sure. > >>> > >>> The status is unchanged. I've had very few free cycles for > >>> such things. > >>> Feel free to take a stab at it if you have some time. I > >>> believe the IOCTL > >>> is used in the Mac OS X code already. > >>> > >>> I don't see any real backwards compatability issues and the > >>> IOCTL should > >>> just work. > >>> > >>> -- > >>> Trent Jarvi > >>> tjarvi at qbang.org > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > From Steffen.DETTMER at ingenico.com Tue Apr 29 13:34:44 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 29 Apr 2008 21:34:44 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Message-ID: <20080429193444.GU2928@elberon.bln.de.ingenico.com> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > The biggest problem that I have seen with lockfiles on Linux > At least is, that it seems there is no standard with respect > To the folder in which they should be created. Also, many > Distributions seem to set up file system permissions in such > A way that writing to the lockfile folder is not allowed for > The normal user -- that's why we stopped using lockfiles > In our commercial product. It seems it depends on the expectations. I consider it as a feature that by default a linux user cannot access serial ports. Maybe root connected a modem (can produce phone bills) or even some serial card reader, maybe with the web servers key pair. I would expect that by default a user cannot open the serial port because of insufficient permissions on the device file. I would expect this on other unices as well (but I don't know it). For windows I think it should be similar but not impacting so much in practice, because often windows users work with big permissions on a somewhat high priviledge level or even Administrator. > If we are to still respect lockfiles, we first need to > Understand where we are expected to look for them. Does > Anybody have any insight what variants of lockfile folder > Schema exist out there in the wild? Some apps like minicom > Seem to even allow users to manually specify a lockfile > Folder of their choice. At least my (ancient) minicom does not allow the user to change this option, it is displayed but read-only, but root is allowed to change it. > Because of the difficulty finding the right lockfile folder, > And because of the inherent risk of thinking that something > Might be locked while it actually isn't, I'd suggest that > RXTX should have a "soft-off" feature that allows disabling > ALL Lockfile checks at runtime without recompiling the native > Sharedlibs. sounds very reasonable, yes... and as admin I would not wish that users could skip such locking because they do things wrong by default ;) (in the end I guess that is related to the dilemma, that hotplug/user-owned-periphery and multi-user systems simply conflict) > Trent - I like your strategy outline, but I think that it > Needs to be configurable by the client such that users and/or > Customer Support can disable lockfiles / disable ioctl in > Case they detect that they are runing on an OS / Kernal that > Does not support one or the other. Yes, this would be good I guess... Applications could offer configuration options to control that, maybe similarily as minicom. BTW, man minicom tells: *B - Lock file location On most systems This should be /usr/spool/uucp. Linux systems use /var/lock. If this directory does not exist, minicom will not attempt to use lockfiles. The statement `Linux systems use /var/lock' is interesting, does anyone know the source of this convention? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Tue Apr 29 16:11:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Apr 2008 16:11:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? These details are outlined in the Filesystem Hierarchy Standard (FHS). http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLOCKLOCKFILES -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Tue Apr 29 18:58:09 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Wed, 30 Apr 2008 10:28:09 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: <200804301028.09307.scldad@sdc.com.au> I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is the same. Any ideas as to how to handle this? Stephen On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: > * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > > The biggest problem that I have seen with lockfiles on Linux > > At least is, that it seems there is no standard with respect > > To the folder in which they should be created. Also, many > > Distributions seem to set up file system permissions in such > > A way that writing to the lockfile folder is not allowed for > > The normal user -- that's why we stopped using lockfiles > > In our commercial product. > > It seems it depends on the expectations. I consider it as a > feature that by default a linux user cannot access serial ports. > Maybe root connected a modem (can produce phone bills) or even > some serial card reader, maybe with the web servers key pair. > > I would expect that by default a user cannot open the serial port > because of insufficient permissions on the device file. I would > expect this on other unices as well (but I don't know it). > > For windows I think it should be similar but not impacting so > much in practice, because often windows users work with big > permissions on a somewhat high priviledge level or even > Administrator. > > > If we are to still respect lockfiles, we first need to > > Understand where we are expected to look for them. Does > > Anybody have any insight what variants of lockfile folder > > Schema exist out there in the wild? Some apps like minicom > > Seem to even allow users to manually specify a lockfile > > Folder of their choice. > > At least my (ancient) minicom does not allow the user to change > this option, it is displayed but read-only, but root is allowed > to change it. > > > Because of the difficulty finding the right lockfile folder, > > And because of the inherent risk of thinking that something > > Might be locked while it actually isn't, I'd suggest that > > RXTX should have a "soft-off" feature that allows disabling > > ALL Lockfile checks at runtime without recompiling the native > > Sharedlibs. > > sounds very reasonable, yes... > and as admin I would not wish that users could skip such > locking because they do things wrong by default ;) > > (in the end I guess that is related to the dilemma, that > hotplug/user-owned-periphery and multi-user systems simply > conflict) > > > Trent - I like your strategy outline, but I think that it > > Needs to be configurable by the client such that users and/or > > Customer Support can disable lockfiles / disable ioctl in > > Case they detect that they are runing on an OS / Kernal that > > Does not support one or the other. > > Yes, this would be good I guess... Applications could offer > configuration options to control that, maybe similarily as > minicom. > > BTW, man minicom tells: > > *B - Lock file location > On most systems This should be /usr/spool/uucp. > Linux systems use /var/lock. If this directory > does not exist, minicom will not attempt to use > lockfiles. > > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure > and expedient electronic transaction acceptance. Ingenico products leverage > proven technology, established standards and unparalleled ergonomics to > provide optimal reliability, versatility and usability. This comprehensive > range of products is complemented by a global array of services and > partnerships, enabling businesses in a number of vertical sectors to accept > transactions anywhere their business takes them. www.ingenico.com This > message may contain confidential and/or privileged information. If you are > not the addressee or authorized to receive this for the addressee, you must > not use, copy, disclose or take any action based on this message or any > information herein. If you have received this message in error, please > advise the sender immediately by reply e-mail and delete this message. > Thank you for your cooperation. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Wed Apr 30 19:30:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 30 Apr 2008 19:30:51 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804301028.09307.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> <200804301028.09307.scldad@sdc.com.au> Message-ID: Hi Stephen, I suspect ioctl/TIOCEXCL open/O_EXCL would do the job. Mac uses TIOCEXCL and it is POSIX. We use O_EXCL for lockfiles on Linux already. On Wed, 30 Apr 2008, Stephen Davies wrote: > I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is > the same. > > Any ideas as to how to handle this? > > Stephen > > > On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: >> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: >>> The biggest problem that I have seen with lockfiles on Linux >>> At least is, that it seems there is no standard with respect >>> To the folder in which they should be created. Also, many >>> Distributions seem to set up file system permissions in such >>> A way that writing to the lockfile folder is not allowed for >>> The normal user -- that's why we stopped using lockfiles >>> In our commercial product. >> >> It seems it depends on the expectations. I consider it as a >> feature that by default a linux user cannot access serial ports. >> Maybe root connected a modem (can produce phone bills) or even >> some serial card reader, maybe with the web servers key pair. >> >> I would expect that by default a user cannot open the serial port >> because of insufficient permissions on the device file. I would >> expect this on other unices as well (but I don't know it). >> >> For windows I think it should be similar but not impacting so >> much in practice, because often windows users work with big >> permissions on a somewhat high priviledge level or even >> Administrator. >> >>> If we are to still respect lockfiles, we first need to >>> Understand where we are expected to look for them. Does >>> Anybody have any insight what variants of lockfile folder >>> Schema exist out there in the wild? Some apps like minicom >>> Seem to even allow users to manually specify a lockfile >>> Folder of their choice. >> >> At least my (ancient) minicom does not allow the user to change >> this option, it is displayed but read-only, but root is allowed >> to change it. >> >>> Because of the difficulty finding the right lockfile folder, >>> And because of the inherent risk of thinking that something >>> Might be locked while it actually isn't, I'd suggest that >>> RXTX should have a "soft-off" feature that allows disabling >>> ALL Lockfile checks at runtime without recompiling the native >>> Sharedlibs. >> >> sounds very reasonable, yes... >> and as admin I would not wish that users could skip such >> locking because they do things wrong by default ;) >> >> (in the end I guess that is related to the dilemma, that >> hotplug/user-owned-periphery and multi-user systems simply >> conflict) >> >>> Trent - I like your strategy outline, but I think that it >>> Needs to be configurable by the client such that users and/or >>> Customer Support can disable lockfiles / disable ioctl in >>> Case they detect that they are runing on an OS / Kernal that >>> Does not support one or the other. >> >> Yes, this would be good I guess... Applications could offer >> configuration options to control that, maybe similarily as >> minicom. >> >> BTW, man minicom tells: >> >> *B - Lock file location >> On most systems This should be /usr/spool/uucp. >> Linux systems use /var/lock. If this directory >> does not exist, minicom will not attempt to use >> lockfiles. >> >> The statement `Linux systems use /var/lock' is interesting, does >> anyone know the source of this convention? >> >> oki, >> >> Steffen >> >> About Ingenico Throughout the world businesses rely on Ingenico for secure >> and expedient electronic transaction acceptance. Ingenico products leverage >> proven technology, established standards and unparalleled ergonomics to >> provide optimal reliability, versatility and usability. This comprehensive >> range of products is complemented by a global array of services and >> partnerships, enabling businesses in a number of vertical sectors to accept >> transactions anywhere their business takes them. www.ingenico.com This >> message may contain confidential and/or privileged information. If you are >> not the addressee or authorized to receive this for the addressee, you must >> not use, copy, disclose or take any action based on this message or any >> information herein. If you have received this message in error, please >> advise the sender immediately by reply e-mail and delete this message. >> Thank you for your cooperation. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0066.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0064.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0051.html From pboulton at pulsetracer.com Fri Apr 18 14:30:13 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Fri, 18 Apr 2008 13:30:13 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site Message-ID: <480904D5.1060307@pulsetracer.com> Hello, gentle serial porters. I have downloaded the zipped up binaries for use on Windows without Sun's CommAPI, but don't seem able to extract anything from the download. Go to main page, http://www.rxtx.org/ Click on Downloads I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) And I save it to disk. If I try and extract the files with WinZip, Winzip thinks the archive is corrupt. If I try using Windows Explorer, I am able to extract it into a single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than the original .zip. Any help would be much appreciated. Sincerely, Philip Boulton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080418/97d89793/attachment-0049.html From tjarvi at qbang.org Fri Apr 18 19:07:00 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 18 Apr 2008 19:07:00 -0600 (MDT) Subject: [Rxtx] Difficulty opening zip file at rxtx site In-Reply-To: <480904D5.1060307@pulsetracer.com> References: <480904D5.1060307@pulsetracer.com> Message-ID: On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org From pboulton at pulsetracer.com Sat Apr 19 12:46:26 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Sat, 19 Apr 2008 11:46:26 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site References: <480904D5.1060307@pulsetracer.com> Message-ID: <53DB7576450695419E09299104043761A78533@ZTGSERVER.ztg.local> I have been able to get my hands on the binaries, by going to the ftp directory /pub/rxtx at ftp.qbang.org,, and ftping the file rxtx-2.1-7-bins-r2.zip . This opens happily with Winzip, and extracts as the set of files that you describe below. I only experience the ill-formed archive problem by clicking the link on the rxtx.org Downloads page (http://rxtx.qbang.org/pub/rxtx/ rxtx-2.1-7-bins-r2.zip ). Not sure what to make of that. Philip Boulton ________________________________ From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Fri 4/18/2008 6:07 PM To: Philip Boulton Cc: rxtx at qbang.org Subject: Re: [Rxtx] Difficulty opening zip file at rxtx site On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080419/147923bb/attachment-0048.html From jlar310 at gmail.com Sat Apr 19 19:11:55 2008 From: jlar310 at gmail.com (Jeff Larsen) Date: Sat, 19 Apr 2008 20:11:55 -0500 Subject: [Rxtx] Moxa serial over Ethernet driver Message-ID: Hi all, I've been using javax.comm for years to communicate with a legacy radio data system. We want to migrate the java side of the system to a VMware Server virtual machine. We've had great success using Moxa DE-303 and 5610 serial over Ethernet appliances and virtual machines for running hylafax. The OS (Linux in this case) uses a kernel driver to communicate with the Moxa via a virtual serial port such as /dev/ttyr00. I want to do the same thing with javax.comm or gnu.io to connect to a virtual serial port. However I'm hitting road blocks everywhere. javax.comm for Linux sees the virtual port, but there are transmission errors. Tried Solaris too, but the Solaris Moxa drivers don't play nice with javax.comm because the driver uses /dev/pts/n instead of /dev/term/x. Next I tried RXTX on Linux, but I'm getting NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX on Solaris. Has anyone used RXTX with serial over Ethernet devices? Any hints on how to make it work? I know that I'm not completely off track because javax.comm does work with Moxa on a Windows platform, but that's just not an option for production deployment. -- Jeff From tjarvi at qbang.org Sat Apr 19 21:08:41 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 19 Apr 2008 21:08:41 -0600 (MDT) Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: yOn Sat, 19 Apr 2008, Jeff Larsen wrote: > Hi all, > > I've been using javax.comm for years to communicate with a legacy > radio data system. We want to migrate the java side of the system to a > VMware Server virtual machine. We've had great success using Moxa > DE-303 and 5610 serial over Ethernet appliances and virtual machines > for running hylafax. The OS (Linux in this case) uses a kernel driver > to communicate with the Moxa via a virtual serial port such as > /dev/ttyr00. > > I want to do the same thing with javax.comm or gnu.io to connect to a > virtual serial port. However I'm hitting road blocks everywhere. > javax.comm for Linux sees the virtual port, but there are transmission > errors. Tried Solaris too, but the Solaris Moxa drivers don't play > nice with javax.comm because the driver uses /dev/pts/n instead of > /dev/term/x. Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris. > > Has anyone used RXTX with serial over Ethernet devices? Any hints on > how to make it work? > > I know that I'm not completely off track because javax.comm does work > with Moxa on a Windows platform, but that's just not an option for > production deployment. > > Moxa should work under linux. There may be minor issues depending upon how complete the kernel driver is but I think it will work. One of the minor issues is /dev/ttyr00 is not enumerated. There are several work arounds documented with the source code and on the wiki. The easiest solution for testing purposes is to make a symbolic link from /dev/ttyr00 to a port that is enumerated such as /dev/ttyS129. You can later alter the rxtx source or use properties to change the enumerated ports. -- Trent Jarvi tjarvi at qbang.org From d.tonhofer at m-plify.com Sun Apr 20 03:33:30 2008 From: d.tonhofer at m-plify.com (David Tonhofer (M-PLIFY S.A.)) Date: Sun, 20 Apr 2008 11:33:30 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: <480B0DEA.5010908@m-plify.com> Jeff Larsen wrote: > Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris It might be that the Java side of RXTX does not recognize that portname. Trying modifying src/RXTXCommDriver.java as described in this case: http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card From ajmas at sympatico.ca Sun Apr 20 16:37:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Apr 2008 18:37:59 -0400 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <480B0DEA.5010908@m-plify.com> References: <480B0DEA.5010908@m-plify.com> Message-ID: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > Jeff Larsen wrote: >> Next I tried RXTX on Linux, but I'm getting >> NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX >> on Solaris > It might be that the Java side of RXTX does not recognize that > portname. > Trying modifying src/RXTXCommDriver.java as described in this case: > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card I wonder whether it would be worth allowing custom port prefixes as a system parameter? For example: gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" Andre From Martin.Oberhuber at windriver.com Tue Apr 22 12:34:36 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 22 Apr 2008 20:34:36 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> References: <480B0DEA.5010908@m-plify.com> <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE6485848056CD6CE@ism-mail03.corp.ad.wrs.com> Sounds like a great idea... I'm wondering how the "variable part" after the Prefixes could be specified though? What about allowing Regular Expression character Classes in the existing System Property for specifying ports: System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyS[0-9],ttyS[ABC],ttyUSB[0-9a-z]"); The set of allowed patterns would of course need to Be restricted compared to REGEX, because it must be A syntax that supports iterating over it. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Montag, 21. April 2008 00:38 > To: rxtx at qbang.org and Users > Subject: Re: [Rxtx] Moxa serial over Ethernet driver > > > On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > > Jeff Larsen wrote: > >> Next I tried RXTX on Linux, but I'm getting > >> NoSuchPortException connecting to /dev/ttyr00. I have yet > to try RXTX > >> on Solaris > > It might be that the Java side of RXTX does not recognize that > > portname. > > Trying modifying src/RXTXCommDriver.java as described in this case: > > > > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_ > SST-4P.2FLP_multiport_card > > I wonder whether it would be worth allowing custom port > prefixes as a > system parameter? For > example: > > gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Loi.TRAN at weatherford.com Tue Apr 22 13:10:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Tue, 22 Apr 2008 14:10:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled Message-ID: Hi, I'm currently using the Java RXTX API to interface to a serial port. The serial port is connected to a bridge board that communicates with our communications system running at 1.875 Mbps which is linked to an embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no flow control). I send a command to the embedded board through the serial-bridge board which then is relayed to the embedded board. The command sent asks the embedded board to dump a binary image. Here's where I'm hitting some problems. I've successfully done this is an integrated serial port from the laptop. The binary file that comes back is consistent on every attempt. When I use the application I've written to do the same thing with a USB-to-serial adapter, the image I get back is not the same as the image I receive through the USB-to-serial adapter is not consistent at all. A final thing is that when I use a terminal program to dump the binary image with the USB-serial adapter, the image is correct. Every time! What is the terminal program doing that's not being done in my application? My application is quite simple. Has anyone observed this behavior before? If you have, I'd like to know how you've gotten around this problem. Thanks, LT =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From tjarvi at qbang.org Tue Apr 22 21:11:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 22 Apr 2008 21:11:10 -0600 (MDT) Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org From Loi.TRAN at weatherford.com Wed Apr 23 08:35:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Wed, 23 Apr 2008 09:35:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: Thanks for all the responses. I finally tried something that worked consistently. I updated my Prolific driver and repeated my tests. It worked. If you're using the Prolific type USB-serial adapters, do no use the Prolific version 2.0.2.1 driver on Windows. Update it to the latest 2.0.2.8 version. Again, thanks for all the responses. LT -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Tuesday, April 22, 2008 10:11 PM To: TRAN, Loi X. Cc: rxtx at qbang.org Subject: Re: [Rxtx] Prolific USB - RXTX data mangled On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From Martin.Oberhuber at windriver.com Wed Apr 23 18:54:26 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 02:54:26 +0200 Subject: [Rxtx] RXTX port locking on Linux status? Message-ID: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Dear RXTX community, I'm wondering what the status is with RXTX locking serial ports on Linux? My understanding is that the mechanism used in 2.1-7r2 (lockfiles) is not really state of the art, and has lots of problems (e.g. missing permissions). There was an idea to migrate towards a Kernel syscall based solution for port locking. What's the status here? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/9878db9f/attachment-0044.html From tjarvi at qbang.org Wed Apr 23 20:32:24 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Apr 2008 20:32:24 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > Dear RXTX community, > > I'm wondering what the status is with RXTX locking > serial ports on Linux? > > My understanding is that the mechanism used in > 2.1-7r2 (lockfiles) is not really state of the art, and > has lots of problems (e.g. missing permissions). > > There was an idea to migrate towards a Kernel > syscall based solution for port locking. > > What's the status here? > Hi Martin, I'm in favor of deprecating the current FHS locking mechanism in favor of an IOCTL when available. I think it will be available on all the platforms but do not know for sure. The status is unchanged. I've had very few free cycles for such things. Feel free to take a stab at it if you have some time. I believe the IOCTL is used in the Mac OS X code already. I don't see any real backwards compatability issues and the IOCTL should just work. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Apr 24 06:14:06 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 14:14:06 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Thanks Trent. Problem is only that I'm really not at all Familiar with the C part of RXTX. If there Were anything I could do in Java for this, It would be easier for me.... ... Are there any C experts here on the list Who'd like to look at ioctl port locking For linux? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Donnerstag, 24. April 2008 04:32 > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > I'm wondering what the status is with RXTX locking > > serial ports on Linux? > > > > My understanding is that the mechanism used in > > 2.1-7r2 (lockfiles) is not really state of the art, and > > has lots of problems (e.g. missing permissions). > > > > There was an idea to migrate towards a Kernel > > syscall based solution for port locking. > > > > What's the status here? > > > > Hi Martin, > > I'm in favor of deprecating the current FHS locking mechanism > in favor of > an IOCTL when available. I think it will be available on all the > platforms but do not know for sure. > > The status is unchanged. I've had very few free cycles for > such things. > Feel free to take a stab at it if you have some time. I > believe the IOCTL > is used in the Mac OS X code already. > > I don't see any real backwards compatability issues and the > IOCTL should > just work. > > -- > Trent Jarvi > tjarvi at qbang.org > From sspies at sloc.de Thu Apr 24 07:15:36 2008 From: sspies at sloc.de (Sebastian Spies) Date: Thu, 24 Apr 2008 15:15:36 +0200 (CEST) Subject: [Rxtx] rxtx on gumstix: Interrupted system call In-Reply-To: <47FB7B20.7080504@sloc.de> References: <47FB7B20.7080504@sloc.de> Message-ID: <55445.130.83.139.205.1209042936.squirrel@ssl.sloc.de> Dear list, while porting rxtx to the gumstix, I found out, that select used in readArray in SerialImp.c might not work as expected. Maybe, because of missing TIOCSERGETLSR-support? select is often interrupted, so i wrote the following quick'n'dirty hack to make it work on gumstix: diff -Nur rxtx-2.1-7r2/src/SerialImp.c rxtx-2.1-7r2/src/SerialImp.c --- rxtx-2.1-7r2/src/SerialImp.c 2006-01-29 23:19:04.000000000 +0100 +++ rxtx-2.1-7r2-patched/src/SerialImp.c 2008-04-24 14:30:17.000000000 +0200 @@ -3380,7 +3381,7 @@ JNIEXPORT jint JNICALL RXTXPort(readArray)( JNIEnv *env, jobject jobj, jbyteArray jbarray, jint offset, jint length ) { - int bytes; + int bytes = 0; jbyte *body; /* char msg[80]; */ int fd = get_java_var( env, jobj, "fd", "I" ); @@ -3397,9 +3398,18 @@ "readArray", "Invalid length" ); return -1; } - body = (*env)->GetByteArrayElements( env, jbarray, 0 ); - bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ - (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + while(1 > bytes) + { + body = (*env)->GetByteArrayElements( env, jbarray, 0 ); + bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ + (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + // quick'n'dirty - SSP + report (" trying again... \n"); + errno = 0; + } + if( bytes < 0 ) { report( "RXTXPort:readArray bytes < 0" ); LEAVE( "RXTXPort:readArray" ); > Hey, > > I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use > RXTXPort$SerialInputStream.read(), then I get the following Exception. I > did not yet figure out which system call is interrupted as strace > produces loads of output. > > Any help would be very appreciated. Thanks in advance. > Sebastian > > > [java] java.io.IOException: Interrupted system call in readArray > [java] at gnu.io.RXTXPort.readArray(Native Method) > [java] at > gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) > [java] at > java.io.FilterInputStream.read(FilterInputStream.java:189) > [java] at > java.io.BufferedInputStream.refill(BufferedInputStream.java:371) > [java] at > java.io.BufferedInputStream.read(BufferedInputStream.java:229) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) > [java] at > com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) > > -- > Sebastian Spies > > mail: sspies at sloc.de > > > > From fire_baptized at hotmail.com Thu Apr 24 18:27:48 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Thu, 24 Apr 2008 20:27:48 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hello I am having a problem with the serial device connecting (software wise) to the serial port. However I have a test program and it seems to work just fine in that environment - and it doesnt use GUI. The error I am getting is : PortNotFoundException Now the way I have it setup in the GUI environment is that once the user pushes a JButton the program connects using this class: protected void establishConnection() { try { portId = CommPortIdentifier.getPortIdentifier("COM3"); System.out.println("Establishing connction....."); messages[0] = "\nEstablishing connction.....\n"; } catch ( NoSuchPortException noport) { System.out.println("Port not found: "+ noport); messages[0] = "Port not found: "+ noport+"\n"; } try { serialPort = (SerialPort) portId.open("serial", 50); System.out.println("Port has been found."); messages[1] = "Port has been found.\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[1] = "" +usedport; } try { serialPort = (SerialPort) portId.open("serial", 50); messages[2] = "Connecting to COM3 on port 50....\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; } try { serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); System.out.println("Esablishing the transfer rate settings for COM3."); messages[3] = "Esablishing the transfer rate settings for COM3.\n"; } catch (UnsupportedCommOperationException nosupcom) { System.out.println(nosupcom); System.out.println("The tranfer rate could not be esblished on COM3."); messages[3] = "The tranfer rate could not be esblished on COM3.\n"; } System.out.println(serialPort.getFlowControlMode()); messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; //sendDataOut(buffer[3],buffer[4]); } I need all the data in this method (and all the string values in this method) to be printed out on a JTextArea. I wont do me any good if not all the text is printed on a JTextArea in another class. So I have the text printing the JTextArea correctly, but everytime the JButton is activated - it gives me that error message. I did add a disconnect button that is supposed to call the serialPort.close(). _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/273fd4ec/attachment-0043.html From tjarvi at qbang.org Thu Apr 24 21:54:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Apr 2008 21:54:10 -0600 (MDT) Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > Hello I am having a problem with the serial device connecting (software > wise) to the serial port. However I have a test program and it seems to > work just fine in that environment - and it doesnt use GUI. The error I > am getting is : PortNotFoundException Now the way I have it setup in the > GUI environment is that once the user pushes a JButton the program > connects using this class: > > protected void establishConnection() { > try { > portId = CommPortIdentifier.getPortIdentifier("COM3"); > System.out.println("Establishing connction....."); > messages[0] = "\nEstablishing connction.....\n"; > } > catch ( NoSuchPortException noport) { > System.out.println("Port not found: "+ noport); > messages[0] = "Port not found: "+ noport+"\n"; > } > try { > serialPort = (SerialPort) portId.open("serial", 50); > System.out.println("Port has been found."); > messages[1] = "Port has been found.\n"; > } > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[1] = "" +usedport; > } ================================================================= > try { > serialPort = (SerialPort) portId.open("serial", 50); > messages[2] = "Connecting to COM3 on port 50....\n"; > } ================================================================== > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > } > try { > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > System.out.println("Esablishing the transfer rate settings for COM3."); > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > } > catch (UnsupportedCommOperationException nosupcom) { > System.out.println(nosupcom); > System.out.println("The tranfer rate could not be esblished on COM3."); > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > } > System.out.println(serialPort.getFlowControlMode()); > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > //sendDataOut(buffer[3],buffer[4]); > } > > I need all the data in this method (and all the string values in this > method) to be printed out on a JTextArea. I wont do me any good if not > all the text is printed on a JTextArea in another class. So I have the > text printing the JTextArea correctly, but everytime the JButton is > activated - it gives me that error message. I did add a disconnect > button that is supposed to call the serialPort.close(). > The open code used twice is going to throw an exception. It may be that you catch the exception above this code and print a confusing message? A common mistake is people will accidently run two copies of their program. The first instance of the program will open the port and prevent enumeration (finding the port) in the second instance of the program. As an example, you may be running your text based application which is preventing the GUI from seeing the port. Enumeration is done by trying to open the port. If the port is open, Enumeration fails. -- Trent Jarvi tjarvi at qbang.org From fire_baptized at hotmail.com Thu Apr 24 22:32:05 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 00:32:05 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Wow - thanks dude what a dumb thing for me to not catch..... now here is the current problem - right now I am trying to output data again one is with the test program - and it seems that serialPort.setRTS(true); is throwing an exceptions there - now if I show this code please bare in mind that I am only testing - the code is kinda sloppy in my mind - but if I can figure out why calling this function is throwing an exception then maybe I can figure out why my GUI application is getting the same null pointer exceptions when try to send out the data stream. FYI Trent this email is not directed towards you - anyone can jump in on this public static void main(String args[]) { byte[] b = new byte[64]; int keyinput = 0 ; byte x = 0; byte y = 0; PortTesting1 testports = new PortTesting1(); try { joyskoro = Joystick.createInstance(); } catch (IOException ioexc) { System.out.println("There is an input/output problem: " + ioexc); } while (true) { joyskoro.poll(); b[0] = ((byte) -(10 * joyskoro.getY())); b[1] = ((byte) (10 * joyskoro.getX())); System.out.println("The 3rd byte is: " +b[0]); System.out.println("The 4rd byte is: " +b[1]); serialPort.setRTS(true); // HERE IS WHERE THE PROBLEM IS !!!!!!! ON THIS LINE but if I dont have it active in my program the Bluetooth device (that is System.out.println("Ready to send :-) !"); //connected to the serial port does not send out data!!!!! if (joyskoro.isButtonDown(joyskoro.BUTTON10)) { System.out.println("Connection terminated."); serialPort.close(); break; } if (joyskoro.isButtonDown(joyskoro.BUTTON2)) { boolean flag = true; //reading from key input from the keyboard System.out.println("Please input a command: "); while (flag) { try { keyinput = System.in.read(); } catch (IOException ioexc) {/*there is no need to put * anything here */ } if((char)keyinput=='w') { pushIt((byte)85); } if((char)keyinput=='s') { pushIt((byte)84); } if((char)keyinput=='a') { pushIt((byte)83); } if((char)keyinput=='d') { pushIt((byte)82); } if((char)keyinput=='q') { pushIt((byte)89); } if((char)keyinput=='\t') { //this stop reading input from the keyboard flag = false; } } and help anyways here is the block of code that throwing an exception for the test program: > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/5c8f7d68/attachment-0043.html From fire_baptized at hotmail.com Fri Apr 25 07:59:53 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 09:59:53 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Are there any examples of how to push out data? As in using input and output streams - if I can compare code maybe I can see where this is causing a problem. I have a byte array that I am pushing out data. I keep getting null pointer exceptions every where I turn. > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/22228ab6/attachment-0042.html From ajmas at sympatico.ca Sat Apr 26 07:37:09 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 26 Apr 2008 09:37:09 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hi, On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote: > > Are there any examples of how to push out data? As in using input > and output streams - if I can compare code maybe I can see where > this is causing a problem. I have a byte array that I am pushing > out data. I keep getting null pointer exceptions every where I turn. > There are some examples here that might be of help: http://rxtx.qbang.org/wiki/index.php/Examples Andre From fire_baptized at hotmail.com Sat Apr 26 20:13:54 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Sat, 26 Apr 2008 22:13:54 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: looked at those....yep didnt help - I need to push out data with GUI and not get a null pointer exception everytime I try. > CC: rxtx at qbang.org> From: ajmas at sympatico.ca> To: fire_baptized at hotmail.com> Subject: Re: [Rxtx] Serial Problems with Gui.....> Date: Sat, 26 Apr 2008 09:37:09 -0400> > Hi,> > > On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote:> >> > Are there any examples of how to push out data? As in using input > > and output streams - if I can compare code maybe I can see where > > this is causing a problem. I have a byte array that I am pushing > > out data. I keep getting null pointer exceptions every where I turn.> >> > There are some examples here that might be of help:> > http://rxtx.qbang.org/wiki/index.php/Examples> > Andre _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080426/09f95b41/attachment-0041.html From michael.erskine at ketech.com Mon Apr 28 02:47:22 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 28 Apr 2008 09:47:22 +0100 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D426EF3CBBC5@no-sv-03.ketech.local> Jesrael D. Summerhill wrote: > looked at those....yep didnt help - I need to push out data with GUI and > not get a null pointer exception everytime I try. So it seems pretty obvious that your code needs to check for nulls wherever one may occur and report what's happening. Alternatively, catch the npe and display the stack trace. Then you can fix your code so it doesn't try to work with something that ain't there. Regards, Michael Erskine. From scldad at sdc.com.au Mon Apr 28 03:58:34 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Mon, 28 Apr 2008 19:28:34 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Message-ID: <200804281928.34454.scldad@sdc.com.au> Has anybody done any design work on this? The first thing that springs to mind is that we still need to check for lock files because other apps tend to use that approach even if we go to ioctl. Cheers, Stephen Davies On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > Thanks Trent. > > Problem is only that I'm really not at all > Familiar with the C part of RXTX. If there > Were anything I could do in Java for this, > It would be easier for me.... > > ... Are there any C experts here on the list > Who'd like to look at ioctl port locking > For linux? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > -----Original Message----- > > From: Trent Jarvi [mailto:tjarvi at qbang.org] > > Sent: Donnerstag, 24. April 2008 04:32 > > To: Oberhuber, Martin > > Cc: rxtx at qbang.org > > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > > > I'm wondering what the status is with RXTX locking > > > serial ports on Linux? > > > > > > My understanding is that the mechanism used in > > > 2.1-7r2 (lockfiles) is not really state of the art, and > > > has lots of problems (e.g. missing permissions). > > > > > > There was an idea to migrate towards a Kernel > > > syscall based solution for port locking. > > > > > > What's the status here? > > > > Hi Martin, > > > > I'm in favor of deprecating the current FHS locking mechanism > > in favor of > > an IOCTL when available. I think it will be available on all the > > platforms but do not know for sure. > > > > The status is unchanged. I've had very few free cycles for > > such things. > > Feel free to take a stab at it if you have some time. I > > believe the IOCTL > > is used in the Mac OS X code already. > > > > I don't see any real backwards compatability issues and the > > IOCTL should > > just work. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Mon Apr 28 04:21:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 28 Apr 2008 04:21:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804281928.34454.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: I don't think there would need to be any architectural changes. A couple ifdefs and minor changes in the current code should be enough. Proposal: FHS/UUCP locks: continue to respect them, try to create them but do not error if the IOCTL is supported. (But does the IOCTL being defined mean it will work?) Enumeration: Do not assert the IOCTL while opening. Serial.open: assert the IOCTL after open. Continue to use locks as described above after asserting the IOCTL. If the IOCTL is defined but not working, handle it here. Failure cases include the IOCTL is not supported and the port is already locked. On Mon, 28 Apr 2008, Stephen Davies wrote: > Has anybody done any design work on this? > The first thing that springs to mind is that we still need to check for lock > files because other apps tend to use that approach even if we go to ioctl. > > Cheers, > Stephen Davies > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: >> Thanks Trent. >> >> Problem is only that I'm really not at all >> Familiar with the C part of RXTX. If there >> Were anything I could do in Java for this, >> It would be easier for me.... >> >> ... Are there any C experts here on the list >> Who'd like to look at ioctl port locking >> For linux? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >>> -----Original Message----- >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] >>> Sent: Donnerstag, 24. April 2008 04:32 >>> To: Oberhuber, Martin >>> Cc: rxtx at qbang.org >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? >>> >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: >>>> Dear RXTX community, >>>> >>>> I'm wondering what the status is with RXTX locking >>>> serial ports on Linux? >>>> >>>> My understanding is that the mechanism used in >>>> 2.1-7r2 (lockfiles) is not really state of the art, and >>>> has lots of problems (e.g. missing permissions). >>>> >>>> There was an idea to migrate towards a Kernel >>>> syscall based solution for port locking. >>>> >>>> What's the status here? >>> >>> Hi Martin, >>> >>> I'm in favor of deprecating the current FHS locking mechanism >>> in favor of >>> an IOCTL when available. I think it will be available on all the >>> platforms but do not know for sure. >>> >>> The status is unchanged. I've had very few free cycles for >>> such things. >>> Feel free to take a stab at it if you have some time. I >>> believe the IOCTL >>> is used in the Mac OS X code already. >>> >>> I don't see any real backwards compatability issues and the >>> IOCTL should >>> just work. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Tue Apr 29 12:04:04 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Apr 2008 20:04:04 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Hi all, The biggest problem that I have seen with lockfiles on Linux At least is, that it seems there is no standard with respect To the folder in which they should be created. Also, many Distributions seem to set up file system permissions in such A way that writing to the lockfile folder is not allowed for The normal user -- that's why we stopped using lockfiles In our commercial product. If we are to still respect lockfiles, we first need to Understand where we are expected to look for them. Does Anybody have any insight what variants of lockfile folder Schema exist out there in the wild? Some apps like minicom Seem to even allow users to manually specify a lockfile Folder of their choice. Because of the difficulty finding the right lockfile folder, And because of the inherent risk of thinking that something Might be locked while it actually isn't, I'd suggest that RXTX should have a "soft-off" feature that allows disabling ALL Lockfile checks at runtime without recompiling the native Sharedlibs. Trent - I like your strategy outline, but I think that it Needs to be configurable by the client such that users and/or Customer Support can disable lockfiles / disable ioctl in Case they detect that they are runing on an OS / Kernal that Does not support one or the other. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Montag, 28. April 2008 12:22 > To: Stephen Davies > Cc: rxtx at qbang.org; Oberhuber, Martin; Trent Jarvi > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > I don't think there would need to be any architectural > changes. A couple > ifdefs and minor changes in the current code should be enough. > > Proposal: > > FHS/UUCP locks: > continue to respect them, try to create them but do not error if > the IOCTL is supported. (But does the IOCTL being defined mean > it will work?) > Enumeration: > Do not assert the IOCTL while opening. > Serial.open: > assert the IOCTL after open. Continue to use locks as described > above after asserting the IOCTL. If the IOCTL is defined but > not working, handle it here. Failure cases include the IOCTL > is not supported and the port is already locked. > > On Mon, 28 Apr 2008, Stephen Davies wrote: > > > Has anybody done any design work on this? > > The first thing that springs to mind is that we still need > to check for lock > > files because other apps tend to use that approach even if > we go to ioctl. > > > > Cheers, > > Stephen Davies > > > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > >> Thanks Trent. > >> > >> Problem is only that I'm really not at all > >> Familiar with the C part of RXTX. If there > >> Were anything I could do in Java for this, > >> It would be easier for me.... > >> > >> ... Are there any C experts here on the list > >> Who'd like to look at ioctl port locking > >> For linux? > >> > >> Thanks, > >> -- > >> Martin Oberhuber, Senior Member of Technical Staff, Wind River > >> Target Management Project Lead, DSDP PMC Member > >> http://www.eclipse.org/dsdp/tm > >> > >>> -----Original Message----- > >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] > >>> Sent: Donnerstag, 24. April 2008 04:32 > >>> To: Oberhuber, Martin > >>> Cc: rxtx at qbang.org > >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? > >>> > >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > >>>> Dear RXTX community, > >>>> > >>>> I'm wondering what the status is with RXTX locking > >>>> serial ports on Linux? > >>>> > >>>> My understanding is that the mechanism used in > >>>> 2.1-7r2 (lockfiles) is not really state of the art, and > >>>> has lots of problems (e.g. missing permissions). > >>>> > >>>> There was an idea to migrate towards a Kernel > >>>> syscall based solution for port locking. > >>>> > >>>> What's the status here? > >>> > >>> Hi Martin, > >>> > >>> I'm in favor of deprecating the current FHS locking mechanism > >>> in favor of > >>> an IOCTL when available. I think it will be available on all the > >>> platforms but do not know for sure. > >>> > >>> The status is unchanged. I've had very few free cycles for > >>> such things. > >>> Feel free to take a stab at it if you have some time. I > >>> believe the IOCTL > >>> is used in the Mac OS X code already. > >>> > >>> I don't see any real backwards compatability issues and the > >>> IOCTL should > >>> just work. > >>> > >>> -- > >>> Trent Jarvi > >>> tjarvi at qbang.org > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > From Steffen.DETTMER at ingenico.com Tue Apr 29 13:34:44 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 29 Apr 2008 21:34:44 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Message-ID: <20080429193444.GU2928@elberon.bln.de.ingenico.com> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > The biggest problem that I have seen with lockfiles on Linux > At least is, that it seems there is no standard with respect > To the folder in which they should be created. Also, many > Distributions seem to set up file system permissions in such > A way that writing to the lockfile folder is not allowed for > The normal user -- that's why we stopped using lockfiles > In our commercial product. It seems it depends on the expectations. I consider it as a feature that by default a linux user cannot access serial ports. Maybe root connected a modem (can produce phone bills) or even some serial card reader, maybe with the web servers key pair. I would expect that by default a user cannot open the serial port because of insufficient permissions on the device file. I would expect this on other unices as well (but I don't know it). For windows I think it should be similar but not impacting so much in practice, because often windows users work with big permissions on a somewhat high priviledge level or even Administrator. > If we are to still respect lockfiles, we first need to > Understand where we are expected to look for them. Does > Anybody have any insight what variants of lockfile folder > Schema exist out there in the wild? Some apps like minicom > Seem to even allow users to manually specify a lockfile > Folder of their choice. At least my (ancient) minicom does not allow the user to change this option, it is displayed but read-only, but root is allowed to change it. > Because of the difficulty finding the right lockfile folder, > And because of the inherent risk of thinking that something > Might be locked while it actually isn't, I'd suggest that > RXTX should have a "soft-off" feature that allows disabling > ALL Lockfile checks at runtime without recompiling the native > Sharedlibs. sounds very reasonable, yes... and as admin I would not wish that users could skip such locking because they do things wrong by default ;) (in the end I guess that is related to the dilemma, that hotplug/user-owned-periphery and multi-user systems simply conflict) > Trent - I like your strategy outline, but I think that it > Needs to be configurable by the client such that users and/or > Customer Support can disable lockfiles / disable ioctl in > Case they detect that they are runing on an OS / Kernal that > Does not support one or the other. Yes, this would be good I guess... Applications could offer configuration options to control that, maybe similarily as minicom. BTW, man minicom tells: *B - Lock file location On most systems This should be /usr/spool/uucp. Linux systems use /var/lock. If this directory does not exist, minicom will not attempt to use lockfiles. The statement `Linux systems use /var/lock' is interesting, does anyone know the source of this convention? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Tue Apr 29 16:11:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Apr 2008 16:11:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? These details are outlined in the Filesystem Hierarchy Standard (FHS). http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLOCKLOCKFILES -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Tue Apr 29 18:58:09 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Wed, 30 Apr 2008 10:28:09 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: <200804301028.09307.scldad@sdc.com.au> I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is the same. Any ideas as to how to handle this? Stephen On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: > * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > > The biggest problem that I have seen with lockfiles on Linux > > At least is, that it seems there is no standard with respect > > To the folder in which they should be created. Also, many > > Distributions seem to set up file system permissions in such > > A way that writing to the lockfile folder is not allowed for > > The normal user -- that's why we stopped using lockfiles > > In our commercial product. > > It seems it depends on the expectations. I consider it as a > feature that by default a linux user cannot access serial ports. > Maybe root connected a modem (can produce phone bills) or even > some serial card reader, maybe with the web servers key pair. > > I would expect that by default a user cannot open the serial port > because of insufficient permissions on the device file. I would > expect this on other unices as well (but I don't know it). > > For windows I think it should be similar but not impacting so > much in practice, because often windows users work with big > permissions on a somewhat high priviledge level or even > Administrator. > > > If we are to still respect lockfiles, we first need to > > Understand where we are expected to look for them. Does > > Anybody have any insight what variants of lockfile folder > > Schema exist out there in the wild? Some apps like minicom > > Seem to even allow users to manually specify a lockfile > > Folder of their choice. > > At least my (ancient) minicom does not allow the user to change > this option, it is displayed but read-only, but root is allowed > to change it. > > > Because of the difficulty finding the right lockfile folder, > > And because of the inherent risk of thinking that something > > Might be locked while it actually isn't, I'd suggest that > > RXTX should have a "soft-off" feature that allows disabling > > ALL Lockfile checks at runtime without recompiling the native > > Sharedlibs. > > sounds very reasonable, yes... > and as admin I would not wish that users could skip such > locking because they do things wrong by default ;) > > (in the end I guess that is related to the dilemma, that > hotplug/user-owned-periphery and multi-user systems simply > conflict) > > > Trent - I like your strategy outline, but I think that it > > Needs to be configurable by the client such that users and/or > > Customer Support can disable lockfiles / disable ioctl in > > Case they detect that they are runing on an OS / Kernal that > > Does not support one or the other. > > Yes, this would be good I guess... Applications could offer > configuration options to control that, maybe similarily as > minicom. > > BTW, man minicom tells: > > *B - Lock file location > On most systems This should be /usr/spool/uucp. > Linux systems use /var/lock. If this directory > does not exist, minicom will not attempt to use > lockfiles. > > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure > and expedient electronic transaction acceptance. Ingenico products leverage > proven technology, established standards and unparalleled ergonomics to > provide optimal reliability, versatility and usability. This comprehensive > range of products is complemented by a global array of services and > partnerships, enabling businesses in a number of vertical sectors to accept > transactions anywhere their business takes them. www.ingenico.com This > message may contain confidential and/or privileged information. If you are > not the addressee or authorized to receive this for the addressee, you must > not use, copy, disclose or take any action based on this message or any > information herein. If you have received this message in error, please > advise the sender immediately by reply e-mail and delete this message. > Thank you for your cooperation. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Wed Apr 30 19:30:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 30 Apr 2008 19:30:51 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804301028.09307.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> <200804301028.09307.scldad@sdc.com.au> Message-ID: Hi Stephen, I suspect ioctl/TIOCEXCL open/O_EXCL would do the job. Mac uses TIOCEXCL and it is POSIX. We use O_EXCL for lockfiles on Linux already. On Wed, 30 Apr 2008, Stephen Davies wrote: > I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is > the same. > > Any ideas as to how to handle this? > > Stephen > > > On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: >> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: >>> The biggest problem that I have seen with lockfiles on Linux >>> At least is, that it seems there is no standard with respect >>> To the folder in which they should be created. Also, many >>> Distributions seem to set up file system permissions in such >>> A way that writing to the lockfile folder is not allowed for >>> The normal user -- that's why we stopped using lockfiles >>> In our commercial product. >> >> It seems it depends on the expectations. I consider it as a >> feature that by default a linux user cannot access serial ports. >> Maybe root connected a modem (can produce phone bills) or even >> some serial card reader, maybe with the web servers key pair. >> >> I would expect that by default a user cannot open the serial port >> because of insufficient permissions on the device file. I would >> expect this on other unices as well (but I don't know it). >> >> For windows I think it should be similar but not impacting so >> much in practice, because often windows users work with big >> permissions on a somewhat high priviledge level or even >> Administrator. >> >>> If we are to still respect lockfiles, we first need to >>> Understand where we are expected to look for them. Does >>> Anybody have any insight what variants of lockfile folder >>> Schema exist out there in the wild? Some apps like minicom >>> Seem to even allow users to manually specify a lockfile >>> Folder of their choice. >> >> At least my (ancient) minicom does not allow the user to change >> this option, it is displayed but read-only, but root is allowed >> to change it. >> >>> Because of the difficulty finding the right lockfile folder, >>> And because of the inherent risk of thinking that something >>> Might be locked while it actually isn't, I'd suggest that >>> RXTX should have a "soft-off" feature that allows disabling >>> ALL Lockfile checks at runtime without recompiling the native >>> Sharedlibs. >> >> sounds very reasonable, yes... >> and as admin I would not wish that users could skip such >> locking because they do things wrong by default ;) >> >> (in the end I guess that is related to the dilemma, that >> hotplug/user-owned-periphery and multi-user systems simply >> conflict) >> >>> Trent - I like your strategy outline, but I think that it >>> Needs to be configurable by the client such that users and/or >>> Customer Support can disable lockfiles / disable ioctl in >>> Case they detect that they are runing on an OS / Kernal that >>> Does not support one or the other. >> >> Yes, this would be good I guess... Applications could offer >> configuration options to control that, maybe similarily as >> minicom. >> >> BTW, man minicom tells: >> >> *B - Lock file location >> On most systems This should be /usr/spool/uucp. >> Linux systems use /var/lock. If this directory >> does not exist, minicom will not attempt to use >> lockfiles. >> >> The statement `Linux systems use /var/lock' is interesting, does >> anyone know the source of this convention? >> >> oki, >> >> Steffen >> >> About Ingenico Throughout the world businesses rely on Ingenico for secure >> and expedient electronic transaction acceptance. Ingenico products leverage >> proven technology, established standards and unparalleled ergonomics to >> provide optimal reliability, versatility and usability. This comprehensive >> range of products is complemented by a global array of services and >> partnerships, enabling businesses in a number of vertical sectors to accept >> transactions anywhere their business takes them. www.ingenico.com This >> message may contain confidential and/or privileged information. If you are >> not the addressee or authorized to receive this for the addressee, you must >> not use, copy, disclose or take any action based on this message or any >> information herein. If you have received this message in error, please >> advise the sender immediately by reply e-mail and delete this message. >> Thank you for your cooperation. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0067.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0065.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0052.html From pboulton at pulsetracer.com Fri Apr 18 14:30:13 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Fri, 18 Apr 2008 13:30:13 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site Message-ID: <480904D5.1060307@pulsetracer.com> Hello, gentle serial porters. I have downloaded the zipped up binaries for use on Windows without Sun's CommAPI, but don't seem able to extract anything from the download. Go to main page, http://www.rxtx.org/ Click on Downloads I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) And I save it to disk. If I try and extract the files with WinZip, Winzip thinks the archive is corrupt. If I try using Windows Explorer, I am able to extract it into a single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than the original .zip. Any help would be much appreciated. Sincerely, Philip Boulton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080418/97d89793/attachment-0050.html From tjarvi at qbang.org Fri Apr 18 19:07:00 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 18 Apr 2008 19:07:00 -0600 (MDT) Subject: [Rxtx] Difficulty opening zip file at rxtx site In-Reply-To: <480904D5.1060307@pulsetracer.com> References: <480904D5.1060307@pulsetracer.com> Message-ID: On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org From pboulton at pulsetracer.com Sat Apr 19 12:46:26 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Sat, 19 Apr 2008 11:46:26 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site References: <480904D5.1060307@pulsetracer.com> Message-ID: <53DB7576450695419E09299104043761A78533@ZTGSERVER.ztg.local> I have been able to get my hands on the binaries, by going to the ftp directory /pub/rxtx at ftp.qbang.org,, and ftping the file rxtx-2.1-7-bins-r2.zip . This opens happily with Winzip, and extracts as the set of files that you describe below. I only experience the ill-formed archive problem by clicking the link on the rxtx.org Downloads page (http://rxtx.qbang.org/pub/rxtx/ rxtx-2.1-7-bins-r2.zip ). Not sure what to make of that. Philip Boulton ________________________________ From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Fri 4/18/2008 6:07 PM To: Philip Boulton Cc: rxtx at qbang.org Subject: Re: [Rxtx] Difficulty opening zip file at rxtx site On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080419/147923bb/attachment-0049.html From jlar310 at gmail.com Sat Apr 19 19:11:55 2008 From: jlar310 at gmail.com (Jeff Larsen) Date: Sat, 19 Apr 2008 20:11:55 -0500 Subject: [Rxtx] Moxa serial over Ethernet driver Message-ID: Hi all, I've been using javax.comm for years to communicate with a legacy radio data system. We want to migrate the java side of the system to a VMware Server virtual machine. We've had great success using Moxa DE-303 and 5610 serial over Ethernet appliances and virtual machines for running hylafax. The OS (Linux in this case) uses a kernel driver to communicate with the Moxa via a virtual serial port such as /dev/ttyr00. I want to do the same thing with javax.comm or gnu.io to connect to a virtual serial port. However I'm hitting road blocks everywhere. javax.comm for Linux sees the virtual port, but there are transmission errors. Tried Solaris too, but the Solaris Moxa drivers don't play nice with javax.comm because the driver uses /dev/pts/n instead of /dev/term/x. Next I tried RXTX on Linux, but I'm getting NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX on Solaris. Has anyone used RXTX with serial over Ethernet devices? Any hints on how to make it work? I know that I'm not completely off track because javax.comm does work with Moxa on a Windows platform, but that's just not an option for production deployment. -- Jeff From tjarvi at qbang.org Sat Apr 19 21:08:41 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 19 Apr 2008 21:08:41 -0600 (MDT) Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: yOn Sat, 19 Apr 2008, Jeff Larsen wrote: > Hi all, > > I've been using javax.comm for years to communicate with a legacy > radio data system. We want to migrate the java side of the system to a > VMware Server virtual machine. We've had great success using Moxa > DE-303 and 5610 serial over Ethernet appliances and virtual machines > for running hylafax. The OS (Linux in this case) uses a kernel driver > to communicate with the Moxa via a virtual serial port such as > /dev/ttyr00. > > I want to do the same thing with javax.comm or gnu.io to connect to a > virtual serial port. However I'm hitting road blocks everywhere. > javax.comm for Linux sees the virtual port, but there are transmission > errors. Tried Solaris too, but the Solaris Moxa drivers don't play > nice with javax.comm because the driver uses /dev/pts/n instead of > /dev/term/x. Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris. > > Has anyone used RXTX with serial over Ethernet devices? Any hints on > how to make it work? > > I know that I'm not completely off track because javax.comm does work > with Moxa on a Windows platform, but that's just not an option for > production deployment. > > Moxa should work under linux. There may be minor issues depending upon how complete the kernel driver is but I think it will work. One of the minor issues is /dev/ttyr00 is not enumerated. There are several work arounds documented with the source code and on the wiki. The easiest solution for testing purposes is to make a symbolic link from /dev/ttyr00 to a port that is enumerated such as /dev/ttyS129. You can later alter the rxtx source or use properties to change the enumerated ports. -- Trent Jarvi tjarvi at qbang.org From d.tonhofer at m-plify.com Sun Apr 20 03:33:30 2008 From: d.tonhofer at m-plify.com (David Tonhofer (M-PLIFY S.A.)) Date: Sun, 20 Apr 2008 11:33:30 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: <480B0DEA.5010908@m-plify.com> Jeff Larsen wrote: > Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris It might be that the Java side of RXTX does not recognize that portname. Trying modifying src/RXTXCommDriver.java as described in this case: http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card From ajmas at sympatico.ca Sun Apr 20 16:37:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Apr 2008 18:37:59 -0400 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <480B0DEA.5010908@m-plify.com> References: <480B0DEA.5010908@m-plify.com> Message-ID: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > Jeff Larsen wrote: >> Next I tried RXTX on Linux, but I'm getting >> NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX >> on Solaris > It might be that the Java side of RXTX does not recognize that > portname. > Trying modifying src/RXTXCommDriver.java as described in this case: > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card I wonder whether it would be worth allowing custom port prefixes as a system parameter? For example: gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" Andre From Martin.Oberhuber at windriver.com Tue Apr 22 12:34:36 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 22 Apr 2008 20:34:36 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> References: <480B0DEA.5010908@m-plify.com> <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE6485848056CD6CE@ism-mail03.corp.ad.wrs.com> Sounds like a great idea... I'm wondering how the "variable part" after the Prefixes could be specified though? What about allowing Regular Expression character Classes in the existing System Property for specifying ports: System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyS[0-9],ttyS[ABC],ttyUSB[0-9a-z]"); The set of allowed patterns would of course need to Be restricted compared to REGEX, because it must be A syntax that supports iterating over it. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Montag, 21. April 2008 00:38 > To: rxtx at qbang.org and Users > Subject: Re: [Rxtx] Moxa serial over Ethernet driver > > > On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > > Jeff Larsen wrote: > >> Next I tried RXTX on Linux, but I'm getting > >> NoSuchPortException connecting to /dev/ttyr00. I have yet > to try RXTX > >> on Solaris > > It might be that the Java side of RXTX does not recognize that > > portname. > > Trying modifying src/RXTXCommDriver.java as described in this case: > > > > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_ > SST-4P.2FLP_multiport_card > > I wonder whether it would be worth allowing custom port > prefixes as a > system parameter? For > example: > > gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Loi.TRAN at weatherford.com Tue Apr 22 13:10:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Tue, 22 Apr 2008 14:10:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled Message-ID: Hi, I'm currently using the Java RXTX API to interface to a serial port. The serial port is connected to a bridge board that communicates with our communications system running at 1.875 Mbps which is linked to an embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no flow control). I send a command to the embedded board through the serial-bridge board which then is relayed to the embedded board. The command sent asks the embedded board to dump a binary image. Here's where I'm hitting some problems. I've successfully done this is an integrated serial port from the laptop. The binary file that comes back is consistent on every attempt. When I use the application I've written to do the same thing with a USB-to-serial adapter, the image I get back is not the same as the image I receive through the USB-to-serial adapter is not consistent at all. A final thing is that when I use a terminal program to dump the binary image with the USB-serial adapter, the image is correct. Every time! What is the terminal program doing that's not being done in my application? My application is quite simple. Has anyone observed this behavior before? If you have, I'd like to know how you've gotten around this problem. Thanks, LT =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From tjarvi at qbang.org Tue Apr 22 21:11:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 22 Apr 2008 21:11:10 -0600 (MDT) Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org From Loi.TRAN at weatherford.com Wed Apr 23 08:35:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Wed, 23 Apr 2008 09:35:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: Thanks for all the responses. I finally tried something that worked consistently. I updated my Prolific driver and repeated my tests. It worked. If you're using the Prolific type USB-serial adapters, do no use the Prolific version 2.0.2.1 driver on Windows. Update it to the latest 2.0.2.8 version. Again, thanks for all the responses. LT -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Tuesday, April 22, 2008 10:11 PM To: TRAN, Loi X. Cc: rxtx at qbang.org Subject: Re: [Rxtx] Prolific USB - RXTX data mangled On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From Martin.Oberhuber at windriver.com Wed Apr 23 18:54:26 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 02:54:26 +0200 Subject: [Rxtx] RXTX port locking on Linux status? Message-ID: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Dear RXTX community, I'm wondering what the status is with RXTX locking serial ports on Linux? My understanding is that the mechanism used in 2.1-7r2 (lockfiles) is not really state of the art, and has lots of problems (e.g. missing permissions). There was an idea to migrate towards a Kernel syscall based solution for port locking. What's the status here? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/9878db9f/attachment-0045.html From tjarvi at qbang.org Wed Apr 23 20:32:24 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Apr 2008 20:32:24 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > Dear RXTX community, > > I'm wondering what the status is with RXTX locking > serial ports on Linux? > > My understanding is that the mechanism used in > 2.1-7r2 (lockfiles) is not really state of the art, and > has lots of problems (e.g. missing permissions). > > There was an idea to migrate towards a Kernel > syscall based solution for port locking. > > What's the status here? > Hi Martin, I'm in favor of deprecating the current FHS locking mechanism in favor of an IOCTL when available. I think it will be available on all the platforms but do not know for sure. The status is unchanged. I've had very few free cycles for such things. Feel free to take a stab at it if you have some time. I believe the IOCTL is used in the Mac OS X code already. I don't see any real backwards compatability issues and the IOCTL should just work. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Apr 24 06:14:06 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 14:14:06 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Thanks Trent. Problem is only that I'm really not at all Familiar with the C part of RXTX. If there Were anything I could do in Java for this, It would be easier for me.... ... Are there any C experts here on the list Who'd like to look at ioctl port locking For linux? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Donnerstag, 24. April 2008 04:32 > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > I'm wondering what the status is with RXTX locking > > serial ports on Linux? > > > > My understanding is that the mechanism used in > > 2.1-7r2 (lockfiles) is not really state of the art, and > > has lots of problems (e.g. missing permissions). > > > > There was an idea to migrate towards a Kernel > > syscall based solution for port locking. > > > > What's the status here? > > > > Hi Martin, > > I'm in favor of deprecating the current FHS locking mechanism > in favor of > an IOCTL when available. I think it will be available on all the > platforms but do not know for sure. > > The status is unchanged. I've had very few free cycles for > such things. > Feel free to take a stab at it if you have some time. I > believe the IOCTL > is used in the Mac OS X code already. > > I don't see any real backwards compatability issues and the > IOCTL should > just work. > > -- > Trent Jarvi > tjarvi at qbang.org > From sspies at sloc.de Thu Apr 24 07:15:36 2008 From: sspies at sloc.de (Sebastian Spies) Date: Thu, 24 Apr 2008 15:15:36 +0200 (CEST) Subject: [Rxtx] rxtx on gumstix: Interrupted system call In-Reply-To: <47FB7B20.7080504@sloc.de> References: <47FB7B20.7080504@sloc.de> Message-ID: <55445.130.83.139.205.1209042936.squirrel@ssl.sloc.de> Dear list, while porting rxtx to the gumstix, I found out, that select used in readArray in SerialImp.c might not work as expected. Maybe, because of missing TIOCSERGETLSR-support? select is often interrupted, so i wrote the following quick'n'dirty hack to make it work on gumstix: diff -Nur rxtx-2.1-7r2/src/SerialImp.c rxtx-2.1-7r2/src/SerialImp.c --- rxtx-2.1-7r2/src/SerialImp.c 2006-01-29 23:19:04.000000000 +0100 +++ rxtx-2.1-7r2-patched/src/SerialImp.c 2008-04-24 14:30:17.000000000 +0200 @@ -3380,7 +3381,7 @@ JNIEXPORT jint JNICALL RXTXPort(readArray)( JNIEnv *env, jobject jobj, jbyteArray jbarray, jint offset, jint length ) { - int bytes; + int bytes = 0; jbyte *body; /* char msg[80]; */ int fd = get_java_var( env, jobj, "fd", "I" ); @@ -3397,9 +3398,18 @@ "readArray", "Invalid length" ); return -1; } - body = (*env)->GetByteArrayElements( env, jbarray, 0 ); - bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ - (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + while(1 > bytes) + { + body = (*env)->GetByteArrayElements( env, jbarray, 0 ); + bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ + (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + // quick'n'dirty - SSP + report (" trying again... \n"); + errno = 0; + } + if( bytes < 0 ) { report( "RXTXPort:readArray bytes < 0" ); LEAVE( "RXTXPort:readArray" ); > Hey, > > I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use > RXTXPort$SerialInputStream.read(), then I get the following Exception. I > did not yet figure out which system call is interrupted as strace > produces loads of output. > > Any help would be very appreciated. Thanks in advance. > Sebastian > > > [java] java.io.IOException: Interrupted system call in readArray > [java] at gnu.io.RXTXPort.readArray(Native Method) > [java] at > gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) > [java] at > java.io.FilterInputStream.read(FilterInputStream.java:189) > [java] at > java.io.BufferedInputStream.refill(BufferedInputStream.java:371) > [java] at > java.io.BufferedInputStream.read(BufferedInputStream.java:229) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) > [java] at > com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) > > -- > Sebastian Spies > > mail: sspies at sloc.de > > > > From fire_baptized at hotmail.com Thu Apr 24 18:27:48 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Thu, 24 Apr 2008 20:27:48 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hello I am having a problem with the serial device connecting (software wise) to the serial port. However I have a test program and it seems to work just fine in that environment - and it doesnt use GUI. The error I am getting is : PortNotFoundException Now the way I have it setup in the GUI environment is that once the user pushes a JButton the program connects using this class: protected void establishConnection() { try { portId = CommPortIdentifier.getPortIdentifier("COM3"); System.out.println("Establishing connction....."); messages[0] = "\nEstablishing connction.....\n"; } catch ( NoSuchPortException noport) { System.out.println("Port not found: "+ noport); messages[0] = "Port not found: "+ noport+"\n"; } try { serialPort = (SerialPort) portId.open("serial", 50); System.out.println("Port has been found."); messages[1] = "Port has been found.\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[1] = "" +usedport; } try { serialPort = (SerialPort) portId.open("serial", 50); messages[2] = "Connecting to COM3 on port 50....\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; } try { serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); System.out.println("Esablishing the transfer rate settings for COM3."); messages[3] = "Esablishing the transfer rate settings for COM3.\n"; } catch (UnsupportedCommOperationException nosupcom) { System.out.println(nosupcom); System.out.println("The tranfer rate could not be esblished on COM3."); messages[3] = "The tranfer rate could not be esblished on COM3.\n"; } System.out.println(serialPort.getFlowControlMode()); messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; //sendDataOut(buffer[3],buffer[4]); } I need all the data in this method (and all the string values in this method) to be printed out on a JTextArea. I wont do me any good if not all the text is printed on a JTextArea in another class. So I have the text printing the JTextArea correctly, but everytime the JButton is activated - it gives me that error message. I did add a disconnect button that is supposed to call the serialPort.close(). _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/273fd4ec/attachment-0044.html From tjarvi at qbang.org Thu Apr 24 21:54:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Apr 2008 21:54:10 -0600 (MDT) Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > Hello I am having a problem with the serial device connecting (software > wise) to the serial port. However I have a test program and it seems to > work just fine in that environment - and it doesnt use GUI. The error I > am getting is : PortNotFoundException Now the way I have it setup in the > GUI environment is that once the user pushes a JButton the program > connects using this class: > > protected void establishConnection() { > try { > portId = CommPortIdentifier.getPortIdentifier("COM3"); > System.out.println("Establishing connction....."); > messages[0] = "\nEstablishing connction.....\n"; > } > catch ( NoSuchPortException noport) { > System.out.println("Port not found: "+ noport); > messages[0] = "Port not found: "+ noport+"\n"; > } > try { > serialPort = (SerialPort) portId.open("serial", 50); > System.out.println("Port has been found."); > messages[1] = "Port has been found.\n"; > } > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[1] = "" +usedport; > } ================================================================= > try { > serialPort = (SerialPort) portId.open("serial", 50); > messages[2] = "Connecting to COM3 on port 50....\n"; > } ================================================================== > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > } > try { > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > System.out.println("Esablishing the transfer rate settings for COM3."); > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > } > catch (UnsupportedCommOperationException nosupcom) { > System.out.println(nosupcom); > System.out.println("The tranfer rate could not be esblished on COM3."); > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > } > System.out.println(serialPort.getFlowControlMode()); > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > //sendDataOut(buffer[3],buffer[4]); > } > > I need all the data in this method (and all the string values in this > method) to be printed out on a JTextArea. I wont do me any good if not > all the text is printed on a JTextArea in another class. So I have the > text printing the JTextArea correctly, but everytime the JButton is > activated - it gives me that error message. I did add a disconnect > button that is supposed to call the serialPort.close(). > The open code used twice is going to throw an exception. It may be that you catch the exception above this code and print a confusing message? A common mistake is people will accidently run two copies of their program. The first instance of the program will open the port and prevent enumeration (finding the port) in the second instance of the program. As an example, you may be running your text based application which is preventing the GUI from seeing the port. Enumeration is done by trying to open the port. If the port is open, Enumeration fails. -- Trent Jarvi tjarvi at qbang.org From fire_baptized at hotmail.com Thu Apr 24 22:32:05 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 00:32:05 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Wow - thanks dude what a dumb thing for me to not catch..... now here is the current problem - right now I am trying to output data again one is with the test program - and it seems that serialPort.setRTS(true); is throwing an exceptions there - now if I show this code please bare in mind that I am only testing - the code is kinda sloppy in my mind - but if I can figure out why calling this function is throwing an exception then maybe I can figure out why my GUI application is getting the same null pointer exceptions when try to send out the data stream. FYI Trent this email is not directed towards you - anyone can jump in on this public static void main(String args[]) { byte[] b = new byte[64]; int keyinput = 0 ; byte x = 0; byte y = 0; PortTesting1 testports = new PortTesting1(); try { joyskoro = Joystick.createInstance(); } catch (IOException ioexc) { System.out.println("There is an input/output problem: " + ioexc); } while (true) { joyskoro.poll(); b[0] = ((byte) -(10 * joyskoro.getY())); b[1] = ((byte) (10 * joyskoro.getX())); System.out.println("The 3rd byte is: " +b[0]); System.out.println("The 4rd byte is: " +b[1]); serialPort.setRTS(true); // HERE IS WHERE THE PROBLEM IS !!!!!!! ON THIS LINE but if I dont have it active in my program the Bluetooth device (that is System.out.println("Ready to send :-) !"); //connected to the serial port does not send out data!!!!! if (joyskoro.isButtonDown(joyskoro.BUTTON10)) { System.out.println("Connection terminated."); serialPort.close(); break; } if (joyskoro.isButtonDown(joyskoro.BUTTON2)) { boolean flag = true; //reading from key input from the keyboard System.out.println("Please input a command: "); while (flag) { try { keyinput = System.in.read(); } catch (IOException ioexc) {/*there is no need to put * anything here */ } if((char)keyinput=='w') { pushIt((byte)85); } if((char)keyinput=='s') { pushIt((byte)84); } if((char)keyinput=='a') { pushIt((byte)83); } if((char)keyinput=='d') { pushIt((byte)82); } if((char)keyinput=='q') { pushIt((byte)89); } if((char)keyinput=='\t') { //this stop reading input from the keyboard flag = false; } } and help anyways here is the block of code that throwing an exception for the test program: > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/5c8f7d68/attachment-0044.html From fire_baptized at hotmail.com Fri Apr 25 07:59:53 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 09:59:53 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Are there any examples of how to push out data? As in using input and output streams - if I can compare code maybe I can see where this is causing a problem. I have a byte array that I am pushing out data. I keep getting null pointer exceptions every where I turn. > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/22228ab6/attachment-0043.html From ajmas at sympatico.ca Sat Apr 26 07:37:09 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 26 Apr 2008 09:37:09 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hi, On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote: > > Are there any examples of how to push out data? As in using input > and output streams - if I can compare code maybe I can see where > this is causing a problem. I have a byte array that I am pushing > out data. I keep getting null pointer exceptions every where I turn. > There are some examples here that might be of help: http://rxtx.qbang.org/wiki/index.php/Examples Andre From fire_baptized at hotmail.com Sat Apr 26 20:13:54 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Sat, 26 Apr 2008 22:13:54 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: looked at those....yep didnt help - I need to push out data with GUI and not get a null pointer exception everytime I try. > CC: rxtx at qbang.org> From: ajmas at sympatico.ca> To: fire_baptized at hotmail.com> Subject: Re: [Rxtx] Serial Problems with Gui.....> Date: Sat, 26 Apr 2008 09:37:09 -0400> > Hi,> > > On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote:> >> > Are there any examples of how to push out data? As in using input > > and output streams - if I can compare code maybe I can see where > > this is causing a problem. I have a byte array that I am pushing > > out data. I keep getting null pointer exceptions every where I turn.> >> > There are some examples here that might be of help:> > http://rxtx.qbang.org/wiki/index.php/Examples> > Andre _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080426/09f95b41/attachment-0042.html From michael.erskine at ketech.com Mon Apr 28 02:47:22 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 28 Apr 2008 09:47:22 +0100 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D426EF3CBBC5@no-sv-03.ketech.local> Jesrael D. Summerhill wrote: > looked at those....yep didnt help - I need to push out data with GUI and > not get a null pointer exception everytime I try. So it seems pretty obvious that your code needs to check for nulls wherever one may occur and report what's happening. Alternatively, catch the npe and display the stack trace. Then you can fix your code so it doesn't try to work with something that ain't there. Regards, Michael Erskine. From scldad at sdc.com.au Mon Apr 28 03:58:34 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Mon, 28 Apr 2008 19:28:34 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Message-ID: <200804281928.34454.scldad@sdc.com.au> Has anybody done any design work on this? The first thing that springs to mind is that we still need to check for lock files because other apps tend to use that approach even if we go to ioctl. Cheers, Stephen Davies On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > Thanks Trent. > > Problem is only that I'm really not at all > Familiar with the C part of RXTX. If there > Were anything I could do in Java for this, > It would be easier for me.... > > ... Are there any C experts here on the list > Who'd like to look at ioctl port locking > For linux? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > -----Original Message----- > > From: Trent Jarvi [mailto:tjarvi at qbang.org] > > Sent: Donnerstag, 24. April 2008 04:32 > > To: Oberhuber, Martin > > Cc: rxtx at qbang.org > > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > > > I'm wondering what the status is with RXTX locking > > > serial ports on Linux? > > > > > > My understanding is that the mechanism used in > > > 2.1-7r2 (lockfiles) is not really state of the art, and > > > has lots of problems (e.g. missing permissions). > > > > > > There was an idea to migrate towards a Kernel > > > syscall based solution for port locking. > > > > > > What's the status here? > > > > Hi Martin, > > > > I'm in favor of deprecating the current FHS locking mechanism > > in favor of > > an IOCTL when available. I think it will be available on all the > > platforms but do not know for sure. > > > > The status is unchanged. I've had very few free cycles for > > such things. > > Feel free to take a stab at it if you have some time. I > > believe the IOCTL > > is used in the Mac OS X code already. > > > > I don't see any real backwards compatability issues and the > > IOCTL should > > just work. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Mon Apr 28 04:21:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 28 Apr 2008 04:21:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804281928.34454.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: I don't think there would need to be any architectural changes. A couple ifdefs and minor changes in the current code should be enough. Proposal: FHS/UUCP locks: continue to respect them, try to create them but do not error if the IOCTL is supported. (But does the IOCTL being defined mean it will work?) Enumeration: Do not assert the IOCTL while opening. Serial.open: assert the IOCTL after open. Continue to use locks as described above after asserting the IOCTL. If the IOCTL is defined but not working, handle it here. Failure cases include the IOCTL is not supported and the port is already locked. On Mon, 28 Apr 2008, Stephen Davies wrote: > Has anybody done any design work on this? > The first thing that springs to mind is that we still need to check for lock > files because other apps tend to use that approach even if we go to ioctl. > > Cheers, > Stephen Davies > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: >> Thanks Trent. >> >> Problem is only that I'm really not at all >> Familiar with the C part of RXTX. If there >> Were anything I could do in Java for this, >> It would be easier for me.... >> >> ... Are there any C experts here on the list >> Who'd like to look at ioctl port locking >> For linux? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >>> -----Original Message----- >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] >>> Sent: Donnerstag, 24. April 2008 04:32 >>> To: Oberhuber, Martin >>> Cc: rxtx at qbang.org >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? >>> >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: >>>> Dear RXTX community, >>>> >>>> I'm wondering what the status is with RXTX locking >>>> serial ports on Linux? >>>> >>>> My understanding is that the mechanism used in >>>> 2.1-7r2 (lockfiles) is not really state of the art, and >>>> has lots of problems (e.g. missing permissions). >>>> >>>> There was an idea to migrate towards a Kernel >>>> syscall based solution for port locking. >>>> >>>> What's the status here? >>> >>> Hi Martin, >>> >>> I'm in favor of deprecating the current FHS locking mechanism >>> in favor of >>> an IOCTL when available. I think it will be available on all the >>> platforms but do not know for sure. >>> >>> The status is unchanged. I've had very few free cycles for >>> such things. >>> Feel free to take a stab at it if you have some time. I >>> believe the IOCTL >>> is used in the Mac OS X code already. >>> >>> I don't see any real backwards compatability issues and the >>> IOCTL should >>> just work. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Tue Apr 29 12:04:04 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Apr 2008 20:04:04 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Hi all, The biggest problem that I have seen with lockfiles on Linux At least is, that it seems there is no standard with respect To the folder in which they should be created. Also, many Distributions seem to set up file system permissions in such A way that writing to the lockfile folder is not allowed for The normal user -- that's why we stopped using lockfiles In our commercial product. If we are to still respect lockfiles, we first need to Understand where we are expected to look for them. Does Anybody have any insight what variants of lockfile folder Schema exist out there in the wild? Some apps like minicom Seem to even allow users to manually specify a lockfile Folder of their choice. Because of the difficulty finding the right lockfile folder, And because of the inherent risk of thinking that something Might be locked while it actually isn't, I'd suggest that RXTX should have a "soft-off" feature that allows disabling ALL Lockfile checks at runtime without recompiling the native Sharedlibs. Trent - I like your strategy outline, but I think that it Needs to be configurable by the client such that users and/or Customer Support can disable lockfiles / disable ioctl in Case they detect that they are runing on an OS / Kernal that Does not support one or the other. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Montag, 28. April 2008 12:22 > To: Stephen Davies > Cc: rxtx at qbang.org; Oberhuber, Martin; Trent Jarvi > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > I don't think there would need to be any architectural > changes. A couple > ifdefs and minor changes in the current code should be enough. > > Proposal: > > FHS/UUCP locks: > continue to respect them, try to create them but do not error if > the IOCTL is supported. (But does the IOCTL being defined mean > it will work?) > Enumeration: > Do not assert the IOCTL while opening. > Serial.open: > assert the IOCTL after open. Continue to use locks as described > above after asserting the IOCTL. If the IOCTL is defined but > not working, handle it here. Failure cases include the IOCTL > is not supported and the port is already locked. > > On Mon, 28 Apr 2008, Stephen Davies wrote: > > > Has anybody done any design work on this? > > The first thing that springs to mind is that we still need > to check for lock > > files because other apps tend to use that approach even if > we go to ioctl. > > > > Cheers, > > Stephen Davies > > > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > >> Thanks Trent. > >> > >> Problem is only that I'm really not at all > >> Familiar with the C part of RXTX. If there > >> Were anything I could do in Java for this, > >> It would be easier for me.... > >> > >> ... Are there any C experts here on the list > >> Who'd like to look at ioctl port locking > >> For linux? > >> > >> Thanks, > >> -- > >> Martin Oberhuber, Senior Member of Technical Staff, Wind River > >> Target Management Project Lead, DSDP PMC Member > >> http://www.eclipse.org/dsdp/tm > >> > >>> -----Original Message----- > >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] > >>> Sent: Donnerstag, 24. April 2008 04:32 > >>> To: Oberhuber, Martin > >>> Cc: rxtx at qbang.org > >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? > >>> > >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > >>>> Dear RXTX community, > >>>> > >>>> I'm wondering what the status is with RXTX locking > >>>> serial ports on Linux? > >>>> > >>>> My understanding is that the mechanism used in > >>>> 2.1-7r2 (lockfiles) is not really state of the art, and > >>>> has lots of problems (e.g. missing permissions). > >>>> > >>>> There was an idea to migrate towards a Kernel > >>>> syscall based solution for port locking. > >>>> > >>>> What's the status here? > >>> > >>> Hi Martin, > >>> > >>> I'm in favor of deprecating the current FHS locking mechanism > >>> in favor of > >>> an IOCTL when available. I think it will be available on all the > >>> platforms but do not know for sure. > >>> > >>> The status is unchanged. I've had very few free cycles for > >>> such things. > >>> Feel free to take a stab at it if you have some time. I > >>> believe the IOCTL > >>> is used in the Mac OS X code already. > >>> > >>> I don't see any real backwards compatability issues and the > >>> IOCTL should > >>> just work. > >>> > >>> -- > >>> Trent Jarvi > >>> tjarvi at qbang.org > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > From Steffen.DETTMER at ingenico.com Tue Apr 29 13:34:44 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 29 Apr 2008 21:34:44 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Message-ID: <20080429193444.GU2928@elberon.bln.de.ingenico.com> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > The biggest problem that I have seen with lockfiles on Linux > At least is, that it seems there is no standard with respect > To the folder in which they should be created. Also, many > Distributions seem to set up file system permissions in such > A way that writing to the lockfile folder is not allowed for > The normal user -- that's why we stopped using lockfiles > In our commercial product. It seems it depends on the expectations. I consider it as a feature that by default a linux user cannot access serial ports. Maybe root connected a modem (can produce phone bills) or even some serial card reader, maybe with the web servers key pair. I would expect that by default a user cannot open the serial port because of insufficient permissions on the device file. I would expect this on other unices as well (but I don't know it). For windows I think it should be similar but not impacting so much in practice, because often windows users work with big permissions on a somewhat high priviledge level or even Administrator. > If we are to still respect lockfiles, we first need to > Understand where we are expected to look for them. Does > Anybody have any insight what variants of lockfile folder > Schema exist out there in the wild? Some apps like minicom > Seem to even allow users to manually specify a lockfile > Folder of their choice. At least my (ancient) minicom does not allow the user to change this option, it is displayed but read-only, but root is allowed to change it. > Because of the difficulty finding the right lockfile folder, > And because of the inherent risk of thinking that something > Might be locked while it actually isn't, I'd suggest that > RXTX should have a "soft-off" feature that allows disabling > ALL Lockfile checks at runtime without recompiling the native > Sharedlibs. sounds very reasonable, yes... and as admin I would not wish that users could skip such locking because they do things wrong by default ;) (in the end I guess that is related to the dilemma, that hotplug/user-owned-periphery and multi-user systems simply conflict) > Trent - I like your strategy outline, but I think that it > Needs to be configurable by the client such that users and/or > Customer Support can disable lockfiles / disable ioctl in > Case they detect that they are runing on an OS / Kernal that > Does not support one or the other. Yes, this would be good I guess... Applications could offer configuration options to control that, maybe similarily as minicom. BTW, man minicom tells: *B - Lock file location On most systems This should be /usr/spool/uucp. Linux systems use /var/lock. If this directory does not exist, minicom will not attempt to use lockfiles. The statement `Linux systems use /var/lock' is interesting, does anyone know the source of this convention? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Tue Apr 29 16:11:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Apr 2008 16:11:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? These details are outlined in the Filesystem Hierarchy Standard (FHS). http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLOCKLOCKFILES -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Tue Apr 29 18:58:09 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Wed, 30 Apr 2008 10:28:09 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: <200804301028.09307.scldad@sdc.com.au> I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is the same. Any ideas as to how to handle this? Stephen On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: > * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > > The biggest problem that I have seen with lockfiles on Linux > > At least is, that it seems there is no standard with respect > > To the folder in which they should be created. Also, many > > Distributions seem to set up file system permissions in such > > A way that writing to the lockfile folder is not allowed for > > The normal user -- that's why we stopped using lockfiles > > In our commercial product. > > It seems it depends on the expectations. I consider it as a > feature that by default a linux user cannot access serial ports. > Maybe root connected a modem (can produce phone bills) or even > some serial card reader, maybe with the web servers key pair. > > I would expect that by default a user cannot open the serial port > because of insufficient permissions on the device file. I would > expect this on other unices as well (but I don't know it). > > For windows I think it should be similar but not impacting so > much in practice, because often windows users work with big > permissions on a somewhat high priviledge level or even > Administrator. > > > If we are to still respect lockfiles, we first need to > > Understand where we are expected to look for them. Does > > Anybody have any insight what variants of lockfile folder > > Schema exist out there in the wild? Some apps like minicom > > Seem to even allow users to manually specify a lockfile > > Folder of their choice. > > At least my (ancient) minicom does not allow the user to change > this option, it is displayed but read-only, but root is allowed > to change it. > > > Because of the difficulty finding the right lockfile folder, > > And because of the inherent risk of thinking that something > > Might be locked while it actually isn't, I'd suggest that > > RXTX should have a "soft-off" feature that allows disabling > > ALL Lockfile checks at runtime without recompiling the native > > Sharedlibs. > > sounds very reasonable, yes... > and as admin I would not wish that users could skip such > locking because they do things wrong by default ;) > > (in the end I guess that is related to the dilemma, that > hotplug/user-owned-periphery and multi-user systems simply > conflict) > > > Trent - I like your strategy outline, but I think that it > > Needs to be configurable by the client such that users and/or > > Customer Support can disable lockfiles / disable ioctl in > > Case they detect that they are runing on an OS / Kernal that > > Does not support one or the other. > > Yes, this would be good I guess... Applications could offer > configuration options to control that, maybe similarily as > minicom. > > BTW, man minicom tells: > > *B - Lock file location > On most systems This should be /usr/spool/uucp. > Linux systems use /var/lock. If this directory > does not exist, minicom will not attempt to use > lockfiles. > > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure > and expedient electronic transaction acceptance. Ingenico products leverage > proven technology, established standards and unparalleled ergonomics to > provide optimal reliability, versatility and usability. This comprehensive > range of products is complemented by a global array of services and > partnerships, enabling businesses in a number of vertical sectors to accept > transactions anywhere their business takes them. www.ingenico.com This > message may contain confidential and/or privileged information. If you are > not the addressee or authorized to receive this for the addressee, you must > not use, copy, disclose or take any action based on this message or any > information herein. If you have received this message in error, please > advise the sender immediately by reply e-mail and delete this message. > Thank you for your cooperation. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Wed Apr 30 19:30:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 30 Apr 2008 19:30:51 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804301028.09307.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> <200804301028.09307.scldad@sdc.com.au> Message-ID: Hi Stephen, I suspect ioctl/TIOCEXCL open/O_EXCL would do the job. Mac uses TIOCEXCL and it is POSIX. We use O_EXCL for lockfiles on Linux already. On Wed, 30 Apr 2008, Stephen Davies wrote: > I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is > the same. > > Any ideas as to how to handle this? > > Stephen > > > On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: >> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: >>> The biggest problem that I have seen with lockfiles on Linux >>> At least is, that it seems there is no standard with respect >>> To the folder in which they should be created. Also, many >>> Distributions seem to set up file system permissions in such >>> A way that writing to the lockfile folder is not allowed for >>> The normal user -- that's why we stopped using lockfiles >>> In our commercial product. >> >> It seems it depends on the expectations. I consider it as a >> feature that by default a linux user cannot access serial ports. >> Maybe root connected a modem (can produce phone bills) or even >> some serial card reader, maybe with the web servers key pair. >> >> I would expect that by default a user cannot open the serial port >> because of insufficient permissions on the device file. I would >> expect this on other unices as well (but I don't know it). >> >> For windows I think it should be similar but not impacting so >> much in practice, because often windows users work with big >> permissions on a somewhat high priviledge level or even >> Administrator. >> >>> If we are to still respect lockfiles, we first need to >>> Understand where we are expected to look for them. Does >>> Anybody have any insight what variants of lockfile folder >>> Schema exist out there in the wild? Some apps like minicom >>> Seem to even allow users to manually specify a lockfile >>> Folder of their choice. >> >> At least my (ancient) minicom does not allow the user to change >> this option, it is displayed but read-only, but root is allowed >> to change it. >> >>> Because of the difficulty finding the right lockfile folder, >>> And because of the inherent risk of thinking that something >>> Might be locked while it actually isn't, I'd suggest that >>> RXTX should have a "soft-off" feature that allows disabling >>> ALL Lockfile checks at runtime without recompiling the native >>> Sharedlibs. >> >> sounds very reasonable, yes... >> and as admin I would not wish that users could skip such >> locking because they do things wrong by default ;) >> >> (in the end I guess that is related to the dilemma, that >> hotplug/user-owned-periphery and multi-user systems simply >> conflict) >> >>> Trent - I like your strategy outline, but I think that it >>> Needs to be configurable by the client such that users and/or >>> Customer Support can disable lockfiles / disable ioctl in >>> Case they detect that they are runing on an OS / Kernal that >>> Does not support one or the other. >> >> Yes, this would be good I guess... Applications could offer >> configuration options to control that, maybe similarily as >> minicom. >> >> BTW, man minicom tells: >> >> *B - Lock file location >> On most systems This should be /usr/spool/uucp. >> Linux systems use /var/lock. If this directory >> does not exist, minicom will not attempt to use >> lockfiles. >> >> The statement `Linux systems use /var/lock' is interesting, does >> anyone know the source of this convention? >> >> oki, >> >> Steffen >> >> About Ingenico Throughout the world businesses rely on Ingenico for secure >> and expedient electronic transaction acceptance. Ingenico products leverage >> proven technology, established standards and unparalleled ergonomics to >> provide optimal reliability, versatility and usability. This comprehensive >> range of products is complemented by a global array of services and >> partnerships, enabling businesses in a number of vertical sectors to accept >> transactions anywhere their business takes them. www.ingenico.com This >> message may contain confidential and/or privileged information. If you are >> not the addressee or authorized to receive this for the addressee, you must >> not use, copy, disclose or take any action based on this message or any >> information herein. If you have received this message in error, please >> advise the sender immediately by reply e-mail and delete this message. >> Thank you for your cooperation. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0068.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0066.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0053.html From pboulton at pulsetracer.com Fri Apr 18 14:30:13 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Fri, 18 Apr 2008 13:30:13 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site Message-ID: <480904D5.1060307@pulsetracer.com> Hello, gentle serial porters. I have downloaded the zipped up binaries for use on Windows without Sun's CommAPI, but don't seem able to extract anything from the download. Go to main page, http://www.rxtx.org/ Click on Downloads I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) And I save it to disk. If I try and extract the files with WinZip, Winzip thinks the archive is corrupt. If I try using Windows Explorer, I am able to extract it into a single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than the original .zip. Any help would be much appreciated. Sincerely, Philip Boulton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080418/97d89793/attachment-0051.html From tjarvi at qbang.org Fri Apr 18 19:07:00 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 18 Apr 2008 19:07:00 -0600 (MDT) Subject: [Rxtx] Difficulty opening zip file at rxtx site In-Reply-To: <480904D5.1060307@pulsetracer.com> References: <480904D5.1060307@pulsetracer.com> Message-ID: On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org From pboulton at pulsetracer.com Sat Apr 19 12:46:26 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Sat, 19 Apr 2008 11:46:26 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site References: <480904D5.1060307@pulsetracer.com> Message-ID: <53DB7576450695419E09299104043761A78533@ZTGSERVER.ztg.local> I have been able to get my hands on the binaries, by going to the ftp directory /pub/rxtx at ftp.qbang.org,, and ftping the file rxtx-2.1-7-bins-r2.zip . This opens happily with Winzip, and extracts as the set of files that you describe below. I only experience the ill-formed archive problem by clicking the link on the rxtx.org Downloads page (http://rxtx.qbang.org/pub/rxtx/ rxtx-2.1-7-bins-r2.zip ). Not sure what to make of that. Philip Boulton ________________________________ From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Fri 4/18/2008 6:07 PM To: Philip Boulton Cc: rxtx at qbang.org Subject: Re: [Rxtx] Difficulty opening zip file at rxtx site On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080419/147923bb/attachment-0050.html From jlar310 at gmail.com Sat Apr 19 19:11:55 2008 From: jlar310 at gmail.com (Jeff Larsen) Date: Sat, 19 Apr 2008 20:11:55 -0500 Subject: [Rxtx] Moxa serial over Ethernet driver Message-ID: Hi all, I've been using javax.comm for years to communicate with a legacy radio data system. We want to migrate the java side of the system to a VMware Server virtual machine. We've had great success using Moxa DE-303 and 5610 serial over Ethernet appliances and virtual machines for running hylafax. The OS (Linux in this case) uses a kernel driver to communicate with the Moxa via a virtual serial port such as /dev/ttyr00. I want to do the same thing with javax.comm or gnu.io to connect to a virtual serial port. However I'm hitting road blocks everywhere. javax.comm for Linux sees the virtual port, but there are transmission errors. Tried Solaris too, but the Solaris Moxa drivers don't play nice with javax.comm because the driver uses /dev/pts/n instead of /dev/term/x. Next I tried RXTX on Linux, but I'm getting NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX on Solaris. Has anyone used RXTX with serial over Ethernet devices? Any hints on how to make it work? I know that I'm not completely off track because javax.comm does work with Moxa on a Windows platform, but that's just not an option for production deployment. -- Jeff From tjarvi at qbang.org Sat Apr 19 21:08:41 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 19 Apr 2008 21:08:41 -0600 (MDT) Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: yOn Sat, 19 Apr 2008, Jeff Larsen wrote: > Hi all, > > I've been using javax.comm for years to communicate with a legacy > radio data system. We want to migrate the java side of the system to a > VMware Server virtual machine. We've had great success using Moxa > DE-303 and 5610 serial over Ethernet appliances and virtual machines > for running hylafax. The OS (Linux in this case) uses a kernel driver > to communicate with the Moxa via a virtual serial port such as > /dev/ttyr00. > > I want to do the same thing with javax.comm or gnu.io to connect to a > virtual serial port. However I'm hitting road blocks everywhere. > javax.comm for Linux sees the virtual port, but there are transmission > errors. Tried Solaris too, but the Solaris Moxa drivers don't play > nice with javax.comm because the driver uses /dev/pts/n instead of > /dev/term/x. Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris. > > Has anyone used RXTX with serial over Ethernet devices? Any hints on > how to make it work? > > I know that I'm not completely off track because javax.comm does work > with Moxa on a Windows platform, but that's just not an option for > production deployment. > > Moxa should work under linux. There may be minor issues depending upon how complete the kernel driver is but I think it will work. One of the minor issues is /dev/ttyr00 is not enumerated. There are several work arounds documented with the source code and on the wiki. The easiest solution for testing purposes is to make a symbolic link from /dev/ttyr00 to a port that is enumerated such as /dev/ttyS129. You can later alter the rxtx source or use properties to change the enumerated ports. -- Trent Jarvi tjarvi at qbang.org From d.tonhofer at m-plify.com Sun Apr 20 03:33:30 2008 From: d.tonhofer at m-plify.com (David Tonhofer (M-PLIFY S.A.)) Date: Sun, 20 Apr 2008 11:33:30 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: <480B0DEA.5010908@m-plify.com> Jeff Larsen wrote: > Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris It might be that the Java side of RXTX does not recognize that portname. Trying modifying src/RXTXCommDriver.java as described in this case: http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card From ajmas at sympatico.ca Sun Apr 20 16:37:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Apr 2008 18:37:59 -0400 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <480B0DEA.5010908@m-plify.com> References: <480B0DEA.5010908@m-plify.com> Message-ID: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > Jeff Larsen wrote: >> Next I tried RXTX on Linux, but I'm getting >> NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX >> on Solaris > It might be that the Java side of RXTX does not recognize that > portname. > Trying modifying src/RXTXCommDriver.java as described in this case: > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card I wonder whether it would be worth allowing custom port prefixes as a system parameter? For example: gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" Andre From Martin.Oberhuber at windriver.com Tue Apr 22 12:34:36 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 22 Apr 2008 20:34:36 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> References: <480B0DEA.5010908@m-plify.com> <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE6485848056CD6CE@ism-mail03.corp.ad.wrs.com> Sounds like a great idea... I'm wondering how the "variable part" after the Prefixes could be specified though? What about allowing Regular Expression character Classes in the existing System Property for specifying ports: System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyS[0-9],ttyS[ABC],ttyUSB[0-9a-z]"); The set of allowed patterns would of course need to Be restricted compared to REGEX, because it must be A syntax that supports iterating over it. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Montag, 21. April 2008 00:38 > To: rxtx at qbang.org and Users > Subject: Re: [Rxtx] Moxa serial over Ethernet driver > > > On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > > Jeff Larsen wrote: > >> Next I tried RXTX on Linux, but I'm getting > >> NoSuchPortException connecting to /dev/ttyr00. I have yet > to try RXTX > >> on Solaris > > It might be that the Java side of RXTX does not recognize that > > portname. > > Trying modifying src/RXTXCommDriver.java as described in this case: > > > > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_ > SST-4P.2FLP_multiport_card > > I wonder whether it would be worth allowing custom port > prefixes as a > system parameter? For > example: > > gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Loi.TRAN at weatherford.com Tue Apr 22 13:10:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Tue, 22 Apr 2008 14:10:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled Message-ID: Hi, I'm currently using the Java RXTX API to interface to a serial port. The serial port is connected to a bridge board that communicates with our communications system running at 1.875 Mbps which is linked to an embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no flow control). I send a command to the embedded board through the serial-bridge board which then is relayed to the embedded board. The command sent asks the embedded board to dump a binary image. Here's where I'm hitting some problems. I've successfully done this is an integrated serial port from the laptop. The binary file that comes back is consistent on every attempt. When I use the application I've written to do the same thing with a USB-to-serial adapter, the image I get back is not the same as the image I receive through the USB-to-serial adapter is not consistent at all. A final thing is that when I use a terminal program to dump the binary image with the USB-serial adapter, the image is correct. Every time! What is the terminal program doing that's not being done in my application? My application is quite simple. Has anyone observed this behavior before? If you have, I'd like to know how you've gotten around this problem. Thanks, LT =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From tjarvi at qbang.org Tue Apr 22 21:11:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 22 Apr 2008 21:11:10 -0600 (MDT) Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org From Loi.TRAN at weatherford.com Wed Apr 23 08:35:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Wed, 23 Apr 2008 09:35:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: Thanks for all the responses. I finally tried something that worked consistently. I updated my Prolific driver and repeated my tests. It worked. If you're using the Prolific type USB-serial adapters, do no use the Prolific version 2.0.2.1 driver on Windows. Update it to the latest 2.0.2.8 version. Again, thanks for all the responses. LT -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Tuesday, April 22, 2008 10:11 PM To: TRAN, Loi X. Cc: rxtx at qbang.org Subject: Re: [Rxtx] Prolific USB - RXTX data mangled On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From Martin.Oberhuber at windriver.com Wed Apr 23 18:54:26 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 02:54:26 +0200 Subject: [Rxtx] RXTX port locking on Linux status? Message-ID: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Dear RXTX community, I'm wondering what the status is with RXTX locking serial ports on Linux? My understanding is that the mechanism used in 2.1-7r2 (lockfiles) is not really state of the art, and has lots of problems (e.g. missing permissions). There was an idea to migrate towards a Kernel syscall based solution for port locking. What's the status here? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/9878db9f/attachment-0046.html From tjarvi at qbang.org Wed Apr 23 20:32:24 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Apr 2008 20:32:24 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > Dear RXTX community, > > I'm wondering what the status is with RXTX locking > serial ports on Linux? > > My understanding is that the mechanism used in > 2.1-7r2 (lockfiles) is not really state of the art, and > has lots of problems (e.g. missing permissions). > > There was an idea to migrate towards a Kernel > syscall based solution for port locking. > > What's the status here? > Hi Martin, I'm in favor of deprecating the current FHS locking mechanism in favor of an IOCTL when available. I think it will be available on all the platforms but do not know for sure. The status is unchanged. I've had very few free cycles for such things. Feel free to take a stab at it if you have some time. I believe the IOCTL is used in the Mac OS X code already. I don't see any real backwards compatability issues and the IOCTL should just work. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Apr 24 06:14:06 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 14:14:06 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Thanks Trent. Problem is only that I'm really not at all Familiar with the C part of RXTX. If there Were anything I could do in Java for this, It would be easier for me.... ... Are there any C experts here on the list Who'd like to look at ioctl port locking For linux? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Donnerstag, 24. April 2008 04:32 > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > I'm wondering what the status is with RXTX locking > > serial ports on Linux? > > > > My understanding is that the mechanism used in > > 2.1-7r2 (lockfiles) is not really state of the art, and > > has lots of problems (e.g. missing permissions). > > > > There was an idea to migrate towards a Kernel > > syscall based solution for port locking. > > > > What's the status here? > > > > Hi Martin, > > I'm in favor of deprecating the current FHS locking mechanism > in favor of > an IOCTL when available. I think it will be available on all the > platforms but do not know for sure. > > The status is unchanged. I've had very few free cycles for > such things. > Feel free to take a stab at it if you have some time. I > believe the IOCTL > is used in the Mac OS X code already. > > I don't see any real backwards compatability issues and the > IOCTL should > just work. > > -- > Trent Jarvi > tjarvi at qbang.org > From sspies at sloc.de Thu Apr 24 07:15:36 2008 From: sspies at sloc.de (Sebastian Spies) Date: Thu, 24 Apr 2008 15:15:36 +0200 (CEST) Subject: [Rxtx] rxtx on gumstix: Interrupted system call In-Reply-To: <47FB7B20.7080504@sloc.de> References: <47FB7B20.7080504@sloc.de> Message-ID: <55445.130.83.139.205.1209042936.squirrel@ssl.sloc.de> Dear list, while porting rxtx to the gumstix, I found out, that select used in readArray in SerialImp.c might not work as expected. Maybe, because of missing TIOCSERGETLSR-support? select is often interrupted, so i wrote the following quick'n'dirty hack to make it work on gumstix: diff -Nur rxtx-2.1-7r2/src/SerialImp.c rxtx-2.1-7r2/src/SerialImp.c --- rxtx-2.1-7r2/src/SerialImp.c 2006-01-29 23:19:04.000000000 +0100 +++ rxtx-2.1-7r2-patched/src/SerialImp.c 2008-04-24 14:30:17.000000000 +0200 @@ -3380,7 +3381,7 @@ JNIEXPORT jint JNICALL RXTXPort(readArray)( JNIEnv *env, jobject jobj, jbyteArray jbarray, jint offset, jint length ) { - int bytes; + int bytes = 0; jbyte *body; /* char msg[80]; */ int fd = get_java_var( env, jobj, "fd", "I" ); @@ -3397,9 +3398,18 @@ "readArray", "Invalid length" ); return -1; } - body = (*env)->GetByteArrayElements( env, jbarray, 0 ); - bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ - (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + while(1 > bytes) + { + body = (*env)->GetByteArrayElements( env, jbarray, 0 ); + bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ + (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + // quick'n'dirty - SSP + report (" trying again... \n"); + errno = 0; + } + if( bytes < 0 ) { report( "RXTXPort:readArray bytes < 0" ); LEAVE( "RXTXPort:readArray" ); > Hey, > > I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use > RXTXPort$SerialInputStream.read(), then I get the following Exception. I > did not yet figure out which system call is interrupted as strace > produces loads of output. > > Any help would be very appreciated. Thanks in advance. > Sebastian > > > [java] java.io.IOException: Interrupted system call in readArray > [java] at gnu.io.RXTXPort.readArray(Native Method) > [java] at > gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) > [java] at > java.io.FilterInputStream.read(FilterInputStream.java:189) > [java] at > java.io.BufferedInputStream.refill(BufferedInputStream.java:371) > [java] at > java.io.BufferedInputStream.read(BufferedInputStream.java:229) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) > [java] at > com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) > > -- > Sebastian Spies > > mail: sspies at sloc.de > > > > From fire_baptized at hotmail.com Thu Apr 24 18:27:48 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Thu, 24 Apr 2008 20:27:48 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hello I am having a problem with the serial device connecting (software wise) to the serial port. However I have a test program and it seems to work just fine in that environment - and it doesnt use GUI. The error I am getting is : PortNotFoundException Now the way I have it setup in the GUI environment is that once the user pushes a JButton the program connects using this class: protected void establishConnection() { try { portId = CommPortIdentifier.getPortIdentifier("COM3"); System.out.println("Establishing connction....."); messages[0] = "\nEstablishing connction.....\n"; } catch ( NoSuchPortException noport) { System.out.println("Port not found: "+ noport); messages[0] = "Port not found: "+ noport+"\n"; } try { serialPort = (SerialPort) portId.open("serial", 50); System.out.println("Port has been found."); messages[1] = "Port has been found.\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[1] = "" +usedport; } try { serialPort = (SerialPort) portId.open("serial", 50); messages[2] = "Connecting to COM3 on port 50....\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; } try { serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); System.out.println("Esablishing the transfer rate settings for COM3."); messages[3] = "Esablishing the transfer rate settings for COM3.\n"; } catch (UnsupportedCommOperationException nosupcom) { System.out.println(nosupcom); System.out.println("The tranfer rate could not be esblished on COM3."); messages[3] = "The tranfer rate could not be esblished on COM3.\n"; } System.out.println(serialPort.getFlowControlMode()); messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; //sendDataOut(buffer[3],buffer[4]); } I need all the data in this method (and all the string values in this method) to be printed out on a JTextArea. I wont do me any good if not all the text is printed on a JTextArea in another class. So I have the text printing the JTextArea correctly, but everytime the JButton is activated - it gives me that error message. I did add a disconnect button that is supposed to call the serialPort.close(). _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/273fd4ec/attachment-0045.html From tjarvi at qbang.org Thu Apr 24 21:54:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Apr 2008 21:54:10 -0600 (MDT) Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > Hello I am having a problem with the serial device connecting (software > wise) to the serial port. However I have a test program and it seems to > work just fine in that environment - and it doesnt use GUI. The error I > am getting is : PortNotFoundException Now the way I have it setup in the > GUI environment is that once the user pushes a JButton the program > connects using this class: > > protected void establishConnection() { > try { > portId = CommPortIdentifier.getPortIdentifier("COM3"); > System.out.println("Establishing connction....."); > messages[0] = "\nEstablishing connction.....\n"; > } > catch ( NoSuchPortException noport) { > System.out.println("Port not found: "+ noport); > messages[0] = "Port not found: "+ noport+"\n"; > } > try { > serialPort = (SerialPort) portId.open("serial", 50); > System.out.println("Port has been found."); > messages[1] = "Port has been found.\n"; > } > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[1] = "" +usedport; > } ================================================================= > try { > serialPort = (SerialPort) portId.open("serial", 50); > messages[2] = "Connecting to COM3 on port 50....\n"; > } ================================================================== > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > } > try { > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > System.out.println("Esablishing the transfer rate settings for COM3."); > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > } > catch (UnsupportedCommOperationException nosupcom) { > System.out.println(nosupcom); > System.out.println("The tranfer rate could not be esblished on COM3."); > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > } > System.out.println(serialPort.getFlowControlMode()); > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > //sendDataOut(buffer[3],buffer[4]); > } > > I need all the data in this method (and all the string values in this > method) to be printed out on a JTextArea. I wont do me any good if not > all the text is printed on a JTextArea in another class. So I have the > text printing the JTextArea correctly, but everytime the JButton is > activated - it gives me that error message. I did add a disconnect > button that is supposed to call the serialPort.close(). > The open code used twice is going to throw an exception. It may be that you catch the exception above this code and print a confusing message? A common mistake is people will accidently run two copies of their program. The first instance of the program will open the port and prevent enumeration (finding the port) in the second instance of the program. As an example, you may be running your text based application which is preventing the GUI from seeing the port. Enumeration is done by trying to open the port. If the port is open, Enumeration fails. -- Trent Jarvi tjarvi at qbang.org From fire_baptized at hotmail.com Thu Apr 24 22:32:05 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 00:32:05 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Wow - thanks dude what a dumb thing for me to not catch..... now here is the current problem - right now I am trying to output data again one is with the test program - and it seems that serialPort.setRTS(true); is throwing an exceptions there - now if I show this code please bare in mind that I am only testing - the code is kinda sloppy in my mind - but if I can figure out why calling this function is throwing an exception then maybe I can figure out why my GUI application is getting the same null pointer exceptions when try to send out the data stream. FYI Trent this email is not directed towards you - anyone can jump in on this public static void main(String args[]) { byte[] b = new byte[64]; int keyinput = 0 ; byte x = 0; byte y = 0; PortTesting1 testports = new PortTesting1(); try { joyskoro = Joystick.createInstance(); } catch (IOException ioexc) { System.out.println("There is an input/output problem: " + ioexc); } while (true) { joyskoro.poll(); b[0] = ((byte) -(10 * joyskoro.getY())); b[1] = ((byte) (10 * joyskoro.getX())); System.out.println("The 3rd byte is: " +b[0]); System.out.println("The 4rd byte is: " +b[1]); serialPort.setRTS(true); // HERE IS WHERE THE PROBLEM IS !!!!!!! ON THIS LINE but if I dont have it active in my program the Bluetooth device (that is System.out.println("Ready to send :-) !"); //connected to the serial port does not send out data!!!!! if (joyskoro.isButtonDown(joyskoro.BUTTON10)) { System.out.println("Connection terminated."); serialPort.close(); break; } if (joyskoro.isButtonDown(joyskoro.BUTTON2)) { boolean flag = true; //reading from key input from the keyboard System.out.println("Please input a command: "); while (flag) { try { keyinput = System.in.read(); } catch (IOException ioexc) {/*there is no need to put * anything here */ } if((char)keyinput=='w') { pushIt((byte)85); } if((char)keyinput=='s') { pushIt((byte)84); } if((char)keyinput=='a') { pushIt((byte)83); } if((char)keyinput=='d') { pushIt((byte)82); } if((char)keyinput=='q') { pushIt((byte)89); } if((char)keyinput=='\t') { //this stop reading input from the keyboard flag = false; } } and help anyways here is the block of code that throwing an exception for the test program: > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/5c8f7d68/attachment-0045.html From fire_baptized at hotmail.com Fri Apr 25 07:59:53 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 09:59:53 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Are there any examples of how to push out data? As in using input and output streams - if I can compare code maybe I can see where this is causing a problem. I have a byte array that I am pushing out data. I keep getting null pointer exceptions every where I turn. > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/22228ab6/attachment-0044.html From ajmas at sympatico.ca Sat Apr 26 07:37:09 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 26 Apr 2008 09:37:09 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hi, On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote: > > Are there any examples of how to push out data? As in using input > and output streams - if I can compare code maybe I can see where > this is causing a problem. I have a byte array that I am pushing > out data. I keep getting null pointer exceptions every where I turn. > There are some examples here that might be of help: http://rxtx.qbang.org/wiki/index.php/Examples Andre From fire_baptized at hotmail.com Sat Apr 26 20:13:54 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Sat, 26 Apr 2008 22:13:54 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: looked at those....yep didnt help - I need to push out data with GUI and not get a null pointer exception everytime I try. > CC: rxtx at qbang.org> From: ajmas at sympatico.ca> To: fire_baptized at hotmail.com> Subject: Re: [Rxtx] Serial Problems with Gui.....> Date: Sat, 26 Apr 2008 09:37:09 -0400> > Hi,> > > On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote:> >> > Are there any examples of how to push out data? As in using input > > and output streams - if I can compare code maybe I can see where > > this is causing a problem. I have a byte array that I am pushing > > out data. I keep getting null pointer exceptions every where I turn.> >> > There are some examples here that might be of help:> > http://rxtx.qbang.org/wiki/index.php/Examples> > Andre _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080426/09f95b41/attachment-0043.html From michael.erskine at ketech.com Mon Apr 28 02:47:22 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 28 Apr 2008 09:47:22 +0100 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D426EF3CBBC5@no-sv-03.ketech.local> Jesrael D. Summerhill wrote: > looked at those....yep didnt help - I need to push out data with GUI and > not get a null pointer exception everytime I try. So it seems pretty obvious that your code needs to check for nulls wherever one may occur and report what's happening. Alternatively, catch the npe and display the stack trace. Then you can fix your code so it doesn't try to work with something that ain't there. Regards, Michael Erskine. From scldad at sdc.com.au Mon Apr 28 03:58:34 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Mon, 28 Apr 2008 19:28:34 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Message-ID: <200804281928.34454.scldad@sdc.com.au> Has anybody done any design work on this? The first thing that springs to mind is that we still need to check for lock files because other apps tend to use that approach even if we go to ioctl. Cheers, Stephen Davies On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > Thanks Trent. > > Problem is only that I'm really not at all > Familiar with the C part of RXTX. If there > Were anything I could do in Java for this, > It would be easier for me.... > > ... Are there any C experts here on the list > Who'd like to look at ioctl port locking > For linux? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > -----Original Message----- > > From: Trent Jarvi [mailto:tjarvi at qbang.org] > > Sent: Donnerstag, 24. April 2008 04:32 > > To: Oberhuber, Martin > > Cc: rxtx at qbang.org > > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > > > I'm wondering what the status is with RXTX locking > > > serial ports on Linux? > > > > > > My understanding is that the mechanism used in > > > 2.1-7r2 (lockfiles) is not really state of the art, and > > > has lots of problems (e.g. missing permissions). > > > > > > There was an idea to migrate towards a Kernel > > > syscall based solution for port locking. > > > > > > What's the status here? > > > > Hi Martin, > > > > I'm in favor of deprecating the current FHS locking mechanism > > in favor of > > an IOCTL when available. I think it will be available on all the > > platforms but do not know for sure. > > > > The status is unchanged. I've had very few free cycles for > > such things. > > Feel free to take a stab at it if you have some time. I > > believe the IOCTL > > is used in the Mac OS X code already. > > > > I don't see any real backwards compatability issues and the > > IOCTL should > > just work. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Mon Apr 28 04:21:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 28 Apr 2008 04:21:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804281928.34454.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: I don't think there would need to be any architectural changes. A couple ifdefs and minor changes in the current code should be enough. Proposal: FHS/UUCP locks: continue to respect them, try to create them but do not error if the IOCTL is supported. (But does the IOCTL being defined mean it will work?) Enumeration: Do not assert the IOCTL while opening. Serial.open: assert the IOCTL after open. Continue to use locks as described above after asserting the IOCTL. If the IOCTL is defined but not working, handle it here. Failure cases include the IOCTL is not supported and the port is already locked. On Mon, 28 Apr 2008, Stephen Davies wrote: > Has anybody done any design work on this? > The first thing that springs to mind is that we still need to check for lock > files because other apps tend to use that approach even if we go to ioctl. > > Cheers, > Stephen Davies > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: >> Thanks Trent. >> >> Problem is only that I'm really not at all >> Familiar with the C part of RXTX. If there >> Were anything I could do in Java for this, >> It would be easier for me.... >> >> ... Are there any C experts here on the list >> Who'd like to look at ioctl port locking >> For linux? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >>> -----Original Message----- >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] >>> Sent: Donnerstag, 24. April 2008 04:32 >>> To: Oberhuber, Martin >>> Cc: rxtx at qbang.org >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? >>> >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: >>>> Dear RXTX community, >>>> >>>> I'm wondering what the status is with RXTX locking >>>> serial ports on Linux? >>>> >>>> My understanding is that the mechanism used in >>>> 2.1-7r2 (lockfiles) is not really state of the art, and >>>> has lots of problems (e.g. missing permissions). >>>> >>>> There was an idea to migrate towards a Kernel >>>> syscall based solution for port locking. >>>> >>>> What's the status here? >>> >>> Hi Martin, >>> >>> I'm in favor of deprecating the current FHS locking mechanism >>> in favor of >>> an IOCTL when available. I think it will be available on all the >>> platforms but do not know for sure. >>> >>> The status is unchanged. I've had very few free cycles for >>> such things. >>> Feel free to take a stab at it if you have some time. I >>> believe the IOCTL >>> is used in the Mac OS X code already. >>> >>> I don't see any real backwards compatability issues and the >>> IOCTL should >>> just work. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Tue Apr 29 12:04:04 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Apr 2008 20:04:04 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Hi all, The biggest problem that I have seen with lockfiles on Linux At least is, that it seems there is no standard with respect To the folder in which they should be created. Also, many Distributions seem to set up file system permissions in such A way that writing to the lockfile folder is not allowed for The normal user -- that's why we stopped using lockfiles In our commercial product. If we are to still respect lockfiles, we first need to Understand where we are expected to look for them. Does Anybody have any insight what variants of lockfile folder Schema exist out there in the wild? Some apps like minicom Seem to even allow users to manually specify a lockfile Folder of their choice. Because of the difficulty finding the right lockfile folder, And because of the inherent risk of thinking that something Might be locked while it actually isn't, I'd suggest that RXTX should have a "soft-off" feature that allows disabling ALL Lockfile checks at runtime without recompiling the native Sharedlibs. Trent - I like your strategy outline, but I think that it Needs to be configurable by the client such that users and/or Customer Support can disable lockfiles / disable ioctl in Case they detect that they are runing on an OS / Kernal that Does not support one or the other. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Montag, 28. April 2008 12:22 > To: Stephen Davies > Cc: rxtx at qbang.org; Oberhuber, Martin; Trent Jarvi > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > I don't think there would need to be any architectural > changes. A couple > ifdefs and minor changes in the current code should be enough. > > Proposal: > > FHS/UUCP locks: > continue to respect them, try to create them but do not error if > the IOCTL is supported. (But does the IOCTL being defined mean > it will work?) > Enumeration: > Do not assert the IOCTL while opening. > Serial.open: > assert the IOCTL after open. Continue to use locks as described > above after asserting the IOCTL. If the IOCTL is defined but > not working, handle it here. Failure cases include the IOCTL > is not supported and the port is already locked. > > On Mon, 28 Apr 2008, Stephen Davies wrote: > > > Has anybody done any design work on this? > > The first thing that springs to mind is that we still need > to check for lock > > files because other apps tend to use that approach even if > we go to ioctl. > > > > Cheers, > > Stephen Davies > > > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > >> Thanks Trent. > >> > >> Problem is only that I'm really not at all > >> Familiar with the C part of RXTX. If there > >> Were anything I could do in Java for this, > >> It would be easier for me.... > >> > >> ... Are there any C experts here on the list > >> Who'd like to look at ioctl port locking > >> For linux? > >> > >> Thanks, > >> -- > >> Martin Oberhuber, Senior Member of Technical Staff, Wind River > >> Target Management Project Lead, DSDP PMC Member > >> http://www.eclipse.org/dsdp/tm > >> > >>> -----Original Message----- > >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] > >>> Sent: Donnerstag, 24. April 2008 04:32 > >>> To: Oberhuber, Martin > >>> Cc: rxtx at qbang.org > >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? > >>> > >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > >>>> Dear RXTX community, > >>>> > >>>> I'm wondering what the status is with RXTX locking > >>>> serial ports on Linux? > >>>> > >>>> My understanding is that the mechanism used in > >>>> 2.1-7r2 (lockfiles) is not really state of the art, and > >>>> has lots of problems (e.g. missing permissions). > >>>> > >>>> There was an idea to migrate towards a Kernel > >>>> syscall based solution for port locking. > >>>> > >>>> What's the status here? > >>> > >>> Hi Martin, > >>> > >>> I'm in favor of deprecating the current FHS locking mechanism > >>> in favor of > >>> an IOCTL when available. I think it will be available on all the > >>> platforms but do not know for sure. > >>> > >>> The status is unchanged. I've had very few free cycles for > >>> such things. > >>> Feel free to take a stab at it if you have some time. I > >>> believe the IOCTL > >>> is used in the Mac OS X code already. > >>> > >>> I don't see any real backwards compatability issues and the > >>> IOCTL should > >>> just work. > >>> > >>> -- > >>> Trent Jarvi > >>> tjarvi at qbang.org > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > From Steffen.DETTMER at ingenico.com Tue Apr 29 13:34:44 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 29 Apr 2008 21:34:44 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Message-ID: <20080429193444.GU2928@elberon.bln.de.ingenico.com> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > The biggest problem that I have seen with lockfiles on Linux > At least is, that it seems there is no standard with respect > To the folder in which they should be created. Also, many > Distributions seem to set up file system permissions in such > A way that writing to the lockfile folder is not allowed for > The normal user -- that's why we stopped using lockfiles > In our commercial product. It seems it depends on the expectations. I consider it as a feature that by default a linux user cannot access serial ports. Maybe root connected a modem (can produce phone bills) or even some serial card reader, maybe with the web servers key pair. I would expect that by default a user cannot open the serial port because of insufficient permissions on the device file. I would expect this on other unices as well (but I don't know it). For windows I think it should be similar but not impacting so much in practice, because often windows users work with big permissions on a somewhat high priviledge level or even Administrator. > If we are to still respect lockfiles, we first need to > Understand where we are expected to look for them. Does > Anybody have any insight what variants of lockfile folder > Schema exist out there in the wild? Some apps like minicom > Seem to even allow users to manually specify a lockfile > Folder of their choice. At least my (ancient) minicom does not allow the user to change this option, it is displayed but read-only, but root is allowed to change it. > Because of the difficulty finding the right lockfile folder, > And because of the inherent risk of thinking that something > Might be locked while it actually isn't, I'd suggest that > RXTX should have a "soft-off" feature that allows disabling > ALL Lockfile checks at runtime without recompiling the native > Sharedlibs. sounds very reasonable, yes... and as admin I would not wish that users could skip such locking because they do things wrong by default ;) (in the end I guess that is related to the dilemma, that hotplug/user-owned-periphery and multi-user systems simply conflict) > Trent - I like your strategy outline, but I think that it > Needs to be configurable by the client such that users and/or > Customer Support can disable lockfiles / disable ioctl in > Case they detect that they are runing on an OS / Kernal that > Does not support one or the other. Yes, this would be good I guess... Applications could offer configuration options to control that, maybe similarily as minicom. BTW, man minicom tells: *B - Lock file location On most systems This should be /usr/spool/uucp. Linux systems use /var/lock. If this directory does not exist, minicom will not attempt to use lockfiles. The statement `Linux systems use /var/lock' is interesting, does anyone know the source of this convention? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Tue Apr 29 16:11:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Apr 2008 16:11:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? These details are outlined in the Filesystem Hierarchy Standard (FHS). http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLOCKLOCKFILES -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Tue Apr 29 18:58:09 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Wed, 30 Apr 2008 10:28:09 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: <200804301028.09307.scldad@sdc.com.au> I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is the same. Any ideas as to how to handle this? Stephen On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: > * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > > The biggest problem that I have seen with lockfiles on Linux > > At least is, that it seems there is no standard with respect > > To the folder in which they should be created. Also, many > > Distributions seem to set up file system permissions in such > > A way that writing to the lockfile folder is not allowed for > > The normal user -- that's why we stopped using lockfiles > > In our commercial product. > > It seems it depends on the expectations. I consider it as a > feature that by default a linux user cannot access serial ports. > Maybe root connected a modem (can produce phone bills) or even > some serial card reader, maybe with the web servers key pair. > > I would expect that by default a user cannot open the serial port > because of insufficient permissions on the device file. I would > expect this on other unices as well (but I don't know it). > > For windows I think it should be similar but not impacting so > much in practice, because often windows users work with big > permissions on a somewhat high priviledge level or even > Administrator. > > > If we are to still respect lockfiles, we first need to > > Understand where we are expected to look for them. Does > > Anybody have any insight what variants of lockfile folder > > Schema exist out there in the wild? Some apps like minicom > > Seem to even allow users to manually specify a lockfile > > Folder of their choice. > > At least my (ancient) minicom does not allow the user to change > this option, it is displayed but read-only, but root is allowed > to change it. > > > Because of the difficulty finding the right lockfile folder, > > And because of the inherent risk of thinking that something > > Might be locked while it actually isn't, I'd suggest that > > RXTX should have a "soft-off" feature that allows disabling > > ALL Lockfile checks at runtime without recompiling the native > > Sharedlibs. > > sounds very reasonable, yes... > and as admin I would not wish that users could skip such > locking because they do things wrong by default ;) > > (in the end I guess that is related to the dilemma, that > hotplug/user-owned-periphery and multi-user systems simply > conflict) > > > Trent - I like your strategy outline, but I think that it > > Needs to be configurable by the client such that users and/or > > Customer Support can disable lockfiles / disable ioctl in > > Case they detect that they are runing on an OS / Kernal that > > Does not support one or the other. > > Yes, this would be good I guess... Applications could offer > configuration options to control that, maybe similarily as > minicom. > > BTW, man minicom tells: > > *B - Lock file location > On most systems This should be /usr/spool/uucp. > Linux systems use /var/lock. If this directory > does not exist, minicom will not attempt to use > lockfiles. > > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure > and expedient electronic transaction acceptance. Ingenico products leverage > proven technology, established standards and unparalleled ergonomics to > provide optimal reliability, versatility and usability. This comprehensive > range of products is complemented by a global array of services and > partnerships, enabling businesses in a number of vertical sectors to accept > transactions anywhere their business takes them. www.ingenico.com This > message may contain confidential and/or privileged information. If you are > not the addressee or authorized to receive this for the addressee, you must > not use, copy, disclose or take any action based on this message or any > information herein. If you have received this message in error, please > advise the sender immediately by reply e-mail and delete this message. > Thank you for your cooperation. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Wed Apr 30 19:30:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 30 Apr 2008 19:30:51 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804301028.09307.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> <200804301028.09307.scldad@sdc.com.au> Message-ID: Hi Stephen, I suspect ioctl/TIOCEXCL open/O_EXCL would do the job. Mac uses TIOCEXCL and it is POSIX. We use O_EXCL for lockfiles on Linux already. On Wed, 30 Apr 2008, Stephen Davies wrote: > I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is > the same. > > Any ideas as to how to handle this? > > Stephen > > > On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: >> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: >>> The biggest problem that I have seen with lockfiles on Linux >>> At least is, that it seems there is no standard with respect >>> To the folder in which they should be created. Also, many >>> Distributions seem to set up file system permissions in such >>> A way that writing to the lockfile folder is not allowed for >>> The normal user -- that's why we stopped using lockfiles >>> In our commercial product. >> >> It seems it depends on the expectations. I consider it as a >> feature that by default a linux user cannot access serial ports. >> Maybe root connected a modem (can produce phone bills) or even >> some serial card reader, maybe with the web servers key pair. >> >> I would expect that by default a user cannot open the serial port >> because of insufficient permissions on the device file. I would >> expect this on other unices as well (but I don't know it). >> >> For windows I think it should be similar but not impacting so >> much in practice, because often windows users work with big >> permissions on a somewhat high priviledge level or even >> Administrator. >> >>> If we are to still respect lockfiles, we first need to >>> Understand where we are expected to look for them. Does >>> Anybody have any insight what variants of lockfile folder >>> Schema exist out there in the wild? Some apps like minicom >>> Seem to even allow users to manually specify a lockfile >>> Folder of their choice. >> >> At least my (ancient) minicom does not allow the user to change >> this option, it is displayed but read-only, but root is allowed >> to change it. >> >>> Because of the difficulty finding the right lockfile folder, >>> And because of the inherent risk of thinking that something >>> Might be locked while it actually isn't, I'd suggest that >>> RXTX should have a "soft-off" feature that allows disabling >>> ALL Lockfile checks at runtime without recompiling the native >>> Sharedlibs. >> >> sounds very reasonable, yes... >> and as admin I would not wish that users could skip such >> locking because they do things wrong by default ;) >> >> (in the end I guess that is related to the dilemma, that >> hotplug/user-owned-periphery and multi-user systems simply >> conflict) >> >>> Trent - I like your strategy outline, but I think that it >>> Needs to be configurable by the client such that users and/or >>> Customer Support can disable lockfiles / disable ioctl in >>> Case they detect that they are runing on an OS / Kernal that >>> Does not support one or the other. >> >> Yes, this would be good I guess... Applications could offer >> configuration options to control that, maybe similarily as >> minicom. >> >> BTW, man minicom tells: >> >> *B - Lock file location >> On most systems This should be /usr/spool/uucp. >> Linux systems use /var/lock. If this directory >> does not exist, minicom will not attempt to use >> lockfiles. >> >> The statement `Linux systems use /var/lock' is interesting, does >> anyone know the source of this convention? >> >> oki, >> >> Steffen >> >> About Ingenico Throughout the world businesses rely on Ingenico for secure >> and expedient electronic transaction acceptance. Ingenico products leverage >> proven technology, established standards and unparalleled ergonomics to >> provide optimal reliability, versatility and usability. This comprehensive >> range of products is complemented by a global array of services and >> partnerships, enabling businesses in a number of vertical sectors to accept >> transactions anywhere their business takes them. www.ingenico.com This >> message may contain confidential and/or privileged information. If you are >> not the addressee or authorized to receive this for the addressee, you must >> not use, copy, disclose or take any action based on this message or any >> information herein. If you have received this message in error, please >> advise the sender immediately by reply e-mail and delete this message. >> Thank you for your cooperation. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0069.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0067.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0054.html From pboulton at pulsetracer.com Fri Apr 18 14:30:13 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Fri, 18 Apr 2008 13:30:13 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site Message-ID: <480904D5.1060307@pulsetracer.com> Hello, gentle serial porters. I have downloaded the zipped up binaries for use on Windows without Sun's CommAPI, but don't seem able to extract anything from the download. Go to main page, http://www.rxtx.org/ Click on Downloads I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) And I save it to disk. If I try and extract the files with WinZip, Winzip thinks the archive is corrupt. If I try using Windows Explorer, I am able to extract it into a single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than the original .zip. Any help would be much appreciated. Sincerely, Philip Boulton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080418/97d89793/attachment-0052.html From tjarvi at qbang.org Fri Apr 18 19:07:00 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 18 Apr 2008 19:07:00 -0600 (MDT) Subject: [Rxtx] Difficulty opening zip file at rxtx site In-Reply-To: <480904D5.1060307@pulsetracer.com> References: <480904D5.1060307@pulsetracer.com> Message-ID: On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org From pboulton at pulsetracer.com Sat Apr 19 12:46:26 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Sat, 19 Apr 2008 11:46:26 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site References: <480904D5.1060307@pulsetracer.com> Message-ID: <53DB7576450695419E09299104043761A78533@ZTGSERVER.ztg.local> I have been able to get my hands on the binaries, by going to the ftp directory /pub/rxtx at ftp.qbang.org,, and ftping the file rxtx-2.1-7-bins-r2.zip . This opens happily with Winzip, and extracts as the set of files that you describe below. I only experience the ill-formed archive problem by clicking the link on the rxtx.org Downloads page (http://rxtx.qbang.org/pub/rxtx/ rxtx-2.1-7-bins-r2.zip ). Not sure what to make of that. Philip Boulton ________________________________ From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Fri 4/18/2008 6:07 PM To: Philip Boulton Cc: rxtx at qbang.org Subject: Re: [Rxtx] Difficulty opening zip file at rxtx site On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080419/147923bb/attachment-0051.html From jlar310 at gmail.com Sat Apr 19 19:11:55 2008 From: jlar310 at gmail.com (Jeff Larsen) Date: Sat, 19 Apr 2008 20:11:55 -0500 Subject: [Rxtx] Moxa serial over Ethernet driver Message-ID: Hi all, I've been using javax.comm for years to communicate with a legacy radio data system. We want to migrate the java side of the system to a VMware Server virtual machine. We've had great success using Moxa DE-303 and 5610 serial over Ethernet appliances and virtual machines for running hylafax. The OS (Linux in this case) uses a kernel driver to communicate with the Moxa via a virtual serial port such as /dev/ttyr00. I want to do the same thing with javax.comm or gnu.io to connect to a virtual serial port. However I'm hitting road blocks everywhere. javax.comm for Linux sees the virtual port, but there are transmission errors. Tried Solaris too, but the Solaris Moxa drivers don't play nice with javax.comm because the driver uses /dev/pts/n instead of /dev/term/x. Next I tried RXTX on Linux, but I'm getting NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX on Solaris. Has anyone used RXTX with serial over Ethernet devices? Any hints on how to make it work? I know that I'm not completely off track because javax.comm does work with Moxa on a Windows platform, but that's just not an option for production deployment. -- Jeff From tjarvi at qbang.org Sat Apr 19 21:08:41 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 19 Apr 2008 21:08:41 -0600 (MDT) Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: yOn Sat, 19 Apr 2008, Jeff Larsen wrote: > Hi all, > > I've been using javax.comm for years to communicate with a legacy > radio data system. We want to migrate the java side of the system to a > VMware Server virtual machine. We've had great success using Moxa > DE-303 and 5610 serial over Ethernet appliances and virtual machines > for running hylafax. The OS (Linux in this case) uses a kernel driver > to communicate with the Moxa via a virtual serial port such as > /dev/ttyr00. > > I want to do the same thing with javax.comm or gnu.io to connect to a > virtual serial port. However I'm hitting road blocks everywhere. > javax.comm for Linux sees the virtual port, but there are transmission > errors. Tried Solaris too, but the Solaris Moxa drivers don't play > nice with javax.comm because the driver uses /dev/pts/n instead of > /dev/term/x. Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris. > > Has anyone used RXTX with serial over Ethernet devices? Any hints on > how to make it work? > > I know that I'm not completely off track because javax.comm does work > with Moxa on a Windows platform, but that's just not an option for > production deployment. > > Moxa should work under linux. There may be minor issues depending upon how complete the kernel driver is but I think it will work. One of the minor issues is /dev/ttyr00 is not enumerated. There are several work arounds documented with the source code and on the wiki. The easiest solution for testing purposes is to make a symbolic link from /dev/ttyr00 to a port that is enumerated such as /dev/ttyS129. You can later alter the rxtx source or use properties to change the enumerated ports. -- Trent Jarvi tjarvi at qbang.org From d.tonhofer at m-plify.com Sun Apr 20 03:33:30 2008 From: d.tonhofer at m-plify.com (David Tonhofer (M-PLIFY S.A.)) Date: Sun, 20 Apr 2008 11:33:30 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: <480B0DEA.5010908@m-plify.com> Jeff Larsen wrote: > Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris It might be that the Java side of RXTX does not recognize that portname. Trying modifying src/RXTXCommDriver.java as described in this case: http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card From ajmas at sympatico.ca Sun Apr 20 16:37:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Apr 2008 18:37:59 -0400 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <480B0DEA.5010908@m-plify.com> References: <480B0DEA.5010908@m-plify.com> Message-ID: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > Jeff Larsen wrote: >> Next I tried RXTX on Linux, but I'm getting >> NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX >> on Solaris > It might be that the Java side of RXTX does not recognize that > portname. > Trying modifying src/RXTXCommDriver.java as described in this case: > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card I wonder whether it would be worth allowing custom port prefixes as a system parameter? For example: gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" Andre From Martin.Oberhuber at windriver.com Tue Apr 22 12:34:36 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 22 Apr 2008 20:34:36 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> References: <480B0DEA.5010908@m-plify.com> <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE6485848056CD6CE@ism-mail03.corp.ad.wrs.com> Sounds like a great idea... I'm wondering how the "variable part" after the Prefixes could be specified though? What about allowing Regular Expression character Classes in the existing System Property for specifying ports: System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyS[0-9],ttyS[ABC],ttyUSB[0-9a-z]"); The set of allowed patterns would of course need to Be restricted compared to REGEX, because it must be A syntax that supports iterating over it. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Montag, 21. April 2008 00:38 > To: rxtx at qbang.org and Users > Subject: Re: [Rxtx] Moxa serial over Ethernet driver > > > On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > > Jeff Larsen wrote: > >> Next I tried RXTX on Linux, but I'm getting > >> NoSuchPortException connecting to /dev/ttyr00. I have yet > to try RXTX > >> on Solaris > > It might be that the Java side of RXTX does not recognize that > > portname. > > Trying modifying src/RXTXCommDriver.java as described in this case: > > > > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_ > SST-4P.2FLP_multiport_card > > I wonder whether it would be worth allowing custom port > prefixes as a > system parameter? For > example: > > gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Loi.TRAN at weatherford.com Tue Apr 22 13:10:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Tue, 22 Apr 2008 14:10:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled Message-ID: Hi, I'm currently using the Java RXTX API to interface to a serial port. The serial port is connected to a bridge board that communicates with our communications system running at 1.875 Mbps which is linked to an embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no flow control). I send a command to the embedded board through the serial-bridge board which then is relayed to the embedded board. The command sent asks the embedded board to dump a binary image. Here's where I'm hitting some problems. I've successfully done this is an integrated serial port from the laptop. The binary file that comes back is consistent on every attempt. When I use the application I've written to do the same thing with a USB-to-serial adapter, the image I get back is not the same as the image I receive through the USB-to-serial adapter is not consistent at all. A final thing is that when I use a terminal program to dump the binary image with the USB-serial adapter, the image is correct. Every time! What is the terminal program doing that's not being done in my application? My application is quite simple. Has anyone observed this behavior before? If you have, I'd like to know how you've gotten around this problem. Thanks, LT =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From tjarvi at qbang.org Tue Apr 22 21:11:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 22 Apr 2008 21:11:10 -0600 (MDT) Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org From Loi.TRAN at weatherford.com Wed Apr 23 08:35:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Wed, 23 Apr 2008 09:35:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: Thanks for all the responses. I finally tried something that worked consistently. I updated my Prolific driver and repeated my tests. It worked. If you're using the Prolific type USB-serial adapters, do no use the Prolific version 2.0.2.1 driver on Windows. Update it to the latest 2.0.2.8 version. Again, thanks for all the responses. LT -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Tuesday, April 22, 2008 10:11 PM To: TRAN, Loi X. Cc: rxtx at qbang.org Subject: Re: [Rxtx] Prolific USB - RXTX data mangled On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From Martin.Oberhuber at windriver.com Wed Apr 23 18:54:26 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 02:54:26 +0200 Subject: [Rxtx] RXTX port locking on Linux status? Message-ID: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Dear RXTX community, I'm wondering what the status is with RXTX locking serial ports on Linux? My understanding is that the mechanism used in 2.1-7r2 (lockfiles) is not really state of the art, and has lots of problems (e.g. missing permissions). There was an idea to migrate towards a Kernel syscall based solution for port locking. What's the status here? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/9878db9f/attachment-0047.html From tjarvi at qbang.org Wed Apr 23 20:32:24 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Apr 2008 20:32:24 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > Dear RXTX community, > > I'm wondering what the status is with RXTX locking > serial ports on Linux? > > My understanding is that the mechanism used in > 2.1-7r2 (lockfiles) is not really state of the art, and > has lots of problems (e.g. missing permissions). > > There was an idea to migrate towards a Kernel > syscall based solution for port locking. > > What's the status here? > Hi Martin, I'm in favor of deprecating the current FHS locking mechanism in favor of an IOCTL when available. I think it will be available on all the platforms but do not know for sure. The status is unchanged. I've had very few free cycles for such things. Feel free to take a stab at it if you have some time. I believe the IOCTL is used in the Mac OS X code already. I don't see any real backwards compatability issues and the IOCTL should just work. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Apr 24 06:14:06 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 14:14:06 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Thanks Trent. Problem is only that I'm really not at all Familiar with the C part of RXTX. If there Were anything I could do in Java for this, It would be easier for me.... ... Are there any C experts here on the list Who'd like to look at ioctl port locking For linux? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Donnerstag, 24. April 2008 04:32 > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > I'm wondering what the status is with RXTX locking > > serial ports on Linux? > > > > My understanding is that the mechanism used in > > 2.1-7r2 (lockfiles) is not really state of the art, and > > has lots of problems (e.g. missing permissions). > > > > There was an idea to migrate towards a Kernel > > syscall based solution for port locking. > > > > What's the status here? > > > > Hi Martin, > > I'm in favor of deprecating the current FHS locking mechanism > in favor of > an IOCTL when available. I think it will be available on all the > platforms but do not know for sure. > > The status is unchanged. I've had very few free cycles for > such things. > Feel free to take a stab at it if you have some time. I > believe the IOCTL > is used in the Mac OS X code already. > > I don't see any real backwards compatability issues and the > IOCTL should > just work. > > -- > Trent Jarvi > tjarvi at qbang.org > From sspies at sloc.de Thu Apr 24 07:15:36 2008 From: sspies at sloc.de (Sebastian Spies) Date: Thu, 24 Apr 2008 15:15:36 +0200 (CEST) Subject: [Rxtx] rxtx on gumstix: Interrupted system call In-Reply-To: <47FB7B20.7080504@sloc.de> References: <47FB7B20.7080504@sloc.de> Message-ID: <55445.130.83.139.205.1209042936.squirrel@ssl.sloc.de> Dear list, while porting rxtx to the gumstix, I found out, that select used in readArray in SerialImp.c might not work as expected. Maybe, because of missing TIOCSERGETLSR-support? select is often interrupted, so i wrote the following quick'n'dirty hack to make it work on gumstix: diff -Nur rxtx-2.1-7r2/src/SerialImp.c rxtx-2.1-7r2/src/SerialImp.c --- rxtx-2.1-7r2/src/SerialImp.c 2006-01-29 23:19:04.000000000 +0100 +++ rxtx-2.1-7r2-patched/src/SerialImp.c 2008-04-24 14:30:17.000000000 +0200 @@ -3380,7 +3381,7 @@ JNIEXPORT jint JNICALL RXTXPort(readArray)( JNIEnv *env, jobject jobj, jbyteArray jbarray, jint offset, jint length ) { - int bytes; + int bytes = 0; jbyte *body; /* char msg[80]; */ int fd = get_java_var( env, jobj, "fd", "I" ); @@ -3397,9 +3398,18 @@ "readArray", "Invalid length" ); return -1; } - body = (*env)->GetByteArrayElements( env, jbarray, 0 ); - bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ - (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + while(1 > bytes) + { + body = (*env)->GetByteArrayElements( env, jbarray, 0 ); + bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ + (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + // quick'n'dirty - SSP + report (" trying again... \n"); + errno = 0; + } + if( bytes < 0 ) { report( "RXTXPort:readArray bytes < 0" ); LEAVE( "RXTXPort:readArray" ); > Hey, > > I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use > RXTXPort$SerialInputStream.read(), then I get the following Exception. I > did not yet figure out which system call is interrupted as strace > produces loads of output. > > Any help would be very appreciated. Thanks in advance. > Sebastian > > > [java] java.io.IOException: Interrupted system call in readArray > [java] at gnu.io.RXTXPort.readArray(Native Method) > [java] at > gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) > [java] at > java.io.FilterInputStream.read(FilterInputStream.java:189) > [java] at > java.io.BufferedInputStream.refill(BufferedInputStream.java:371) > [java] at > java.io.BufferedInputStream.read(BufferedInputStream.java:229) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) > [java] at > com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) > > -- > Sebastian Spies > > mail: sspies at sloc.de > > > > From fire_baptized at hotmail.com Thu Apr 24 18:27:48 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Thu, 24 Apr 2008 20:27:48 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hello I am having a problem with the serial device connecting (software wise) to the serial port. However I have a test program and it seems to work just fine in that environment - and it doesnt use GUI. The error I am getting is : PortNotFoundException Now the way I have it setup in the GUI environment is that once the user pushes a JButton the program connects using this class: protected void establishConnection() { try { portId = CommPortIdentifier.getPortIdentifier("COM3"); System.out.println("Establishing connction....."); messages[0] = "\nEstablishing connction.....\n"; } catch ( NoSuchPortException noport) { System.out.println("Port not found: "+ noport); messages[0] = "Port not found: "+ noport+"\n"; } try { serialPort = (SerialPort) portId.open("serial", 50); System.out.println("Port has been found."); messages[1] = "Port has been found.\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[1] = "" +usedport; } try { serialPort = (SerialPort) portId.open("serial", 50); messages[2] = "Connecting to COM3 on port 50....\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; } try { serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); System.out.println("Esablishing the transfer rate settings for COM3."); messages[3] = "Esablishing the transfer rate settings for COM3.\n"; } catch (UnsupportedCommOperationException nosupcom) { System.out.println(nosupcom); System.out.println("The tranfer rate could not be esblished on COM3."); messages[3] = "The tranfer rate could not be esblished on COM3.\n"; } System.out.println(serialPort.getFlowControlMode()); messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; //sendDataOut(buffer[3],buffer[4]); } I need all the data in this method (and all the string values in this method) to be printed out on a JTextArea. I wont do me any good if not all the text is printed on a JTextArea in another class. So I have the text printing the JTextArea correctly, but everytime the JButton is activated - it gives me that error message. I did add a disconnect button that is supposed to call the serialPort.close(). _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/273fd4ec/attachment-0046.html From tjarvi at qbang.org Thu Apr 24 21:54:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Apr 2008 21:54:10 -0600 (MDT) Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > Hello I am having a problem with the serial device connecting (software > wise) to the serial port. However I have a test program and it seems to > work just fine in that environment - and it doesnt use GUI. The error I > am getting is : PortNotFoundException Now the way I have it setup in the > GUI environment is that once the user pushes a JButton the program > connects using this class: > > protected void establishConnection() { > try { > portId = CommPortIdentifier.getPortIdentifier("COM3"); > System.out.println("Establishing connction....."); > messages[0] = "\nEstablishing connction.....\n"; > } > catch ( NoSuchPortException noport) { > System.out.println("Port not found: "+ noport); > messages[0] = "Port not found: "+ noport+"\n"; > } > try { > serialPort = (SerialPort) portId.open("serial", 50); > System.out.println("Port has been found."); > messages[1] = "Port has been found.\n"; > } > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[1] = "" +usedport; > } ================================================================= > try { > serialPort = (SerialPort) portId.open("serial", 50); > messages[2] = "Connecting to COM3 on port 50....\n"; > } ================================================================== > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > } > try { > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > System.out.println("Esablishing the transfer rate settings for COM3."); > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > } > catch (UnsupportedCommOperationException nosupcom) { > System.out.println(nosupcom); > System.out.println("The tranfer rate could not be esblished on COM3."); > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > } > System.out.println(serialPort.getFlowControlMode()); > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > //sendDataOut(buffer[3],buffer[4]); > } > > I need all the data in this method (and all the string values in this > method) to be printed out on a JTextArea. I wont do me any good if not > all the text is printed on a JTextArea in another class. So I have the > text printing the JTextArea correctly, but everytime the JButton is > activated - it gives me that error message. I did add a disconnect > button that is supposed to call the serialPort.close(). > The open code used twice is going to throw an exception. It may be that you catch the exception above this code and print a confusing message? A common mistake is people will accidently run two copies of their program. The first instance of the program will open the port and prevent enumeration (finding the port) in the second instance of the program. As an example, you may be running your text based application which is preventing the GUI from seeing the port. Enumeration is done by trying to open the port. If the port is open, Enumeration fails. -- Trent Jarvi tjarvi at qbang.org From fire_baptized at hotmail.com Thu Apr 24 22:32:05 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 00:32:05 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Wow - thanks dude what a dumb thing for me to not catch..... now here is the current problem - right now I am trying to output data again one is with the test program - and it seems that serialPort.setRTS(true); is throwing an exceptions there - now if I show this code please bare in mind that I am only testing - the code is kinda sloppy in my mind - but if I can figure out why calling this function is throwing an exception then maybe I can figure out why my GUI application is getting the same null pointer exceptions when try to send out the data stream. FYI Trent this email is not directed towards you - anyone can jump in on this public static void main(String args[]) { byte[] b = new byte[64]; int keyinput = 0 ; byte x = 0; byte y = 0; PortTesting1 testports = new PortTesting1(); try { joyskoro = Joystick.createInstance(); } catch (IOException ioexc) { System.out.println("There is an input/output problem: " + ioexc); } while (true) { joyskoro.poll(); b[0] = ((byte) -(10 * joyskoro.getY())); b[1] = ((byte) (10 * joyskoro.getX())); System.out.println("The 3rd byte is: " +b[0]); System.out.println("The 4rd byte is: " +b[1]); serialPort.setRTS(true); // HERE IS WHERE THE PROBLEM IS !!!!!!! ON THIS LINE but if I dont have it active in my program the Bluetooth device (that is System.out.println("Ready to send :-) !"); //connected to the serial port does not send out data!!!!! if (joyskoro.isButtonDown(joyskoro.BUTTON10)) { System.out.println("Connection terminated."); serialPort.close(); break; } if (joyskoro.isButtonDown(joyskoro.BUTTON2)) { boolean flag = true; //reading from key input from the keyboard System.out.println("Please input a command: "); while (flag) { try { keyinput = System.in.read(); } catch (IOException ioexc) {/*there is no need to put * anything here */ } if((char)keyinput=='w') { pushIt((byte)85); } if((char)keyinput=='s') { pushIt((byte)84); } if((char)keyinput=='a') { pushIt((byte)83); } if((char)keyinput=='d') { pushIt((byte)82); } if((char)keyinput=='q') { pushIt((byte)89); } if((char)keyinput=='\t') { //this stop reading input from the keyboard flag = false; } } and help anyways here is the block of code that throwing an exception for the test program: > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/5c8f7d68/attachment-0046.html From fire_baptized at hotmail.com Fri Apr 25 07:59:53 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 09:59:53 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Are there any examples of how to push out data? As in using input and output streams - if I can compare code maybe I can see where this is causing a problem. I have a byte array that I am pushing out data. I keep getting null pointer exceptions every where I turn. > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/22228ab6/attachment-0045.html From ajmas at sympatico.ca Sat Apr 26 07:37:09 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 26 Apr 2008 09:37:09 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hi, On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote: > > Are there any examples of how to push out data? As in using input > and output streams - if I can compare code maybe I can see where > this is causing a problem. I have a byte array that I am pushing > out data. I keep getting null pointer exceptions every where I turn. > There are some examples here that might be of help: http://rxtx.qbang.org/wiki/index.php/Examples Andre From fire_baptized at hotmail.com Sat Apr 26 20:13:54 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Sat, 26 Apr 2008 22:13:54 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: looked at those....yep didnt help - I need to push out data with GUI and not get a null pointer exception everytime I try. > CC: rxtx at qbang.org> From: ajmas at sympatico.ca> To: fire_baptized at hotmail.com> Subject: Re: [Rxtx] Serial Problems with Gui.....> Date: Sat, 26 Apr 2008 09:37:09 -0400> > Hi,> > > On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote:> >> > Are there any examples of how to push out data? As in using input > > and output streams - if I can compare code maybe I can see where > > this is causing a problem. I have a byte array that I am pushing > > out data. I keep getting null pointer exceptions every where I turn.> >> > There are some examples here that might be of help:> > http://rxtx.qbang.org/wiki/index.php/Examples> > Andre _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080426/09f95b41/attachment-0044.html From michael.erskine at ketech.com Mon Apr 28 02:47:22 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 28 Apr 2008 09:47:22 +0100 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D426EF3CBBC5@no-sv-03.ketech.local> Jesrael D. Summerhill wrote: > looked at those....yep didnt help - I need to push out data with GUI and > not get a null pointer exception everytime I try. So it seems pretty obvious that your code needs to check for nulls wherever one may occur and report what's happening. Alternatively, catch the npe and display the stack trace. Then you can fix your code so it doesn't try to work with something that ain't there. Regards, Michael Erskine. From scldad at sdc.com.au Mon Apr 28 03:58:34 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Mon, 28 Apr 2008 19:28:34 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Message-ID: <200804281928.34454.scldad@sdc.com.au> Has anybody done any design work on this? The first thing that springs to mind is that we still need to check for lock files because other apps tend to use that approach even if we go to ioctl. Cheers, Stephen Davies On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > Thanks Trent. > > Problem is only that I'm really not at all > Familiar with the C part of RXTX. If there > Were anything I could do in Java for this, > It would be easier for me.... > > ... Are there any C experts here on the list > Who'd like to look at ioctl port locking > For linux? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > -----Original Message----- > > From: Trent Jarvi [mailto:tjarvi at qbang.org] > > Sent: Donnerstag, 24. April 2008 04:32 > > To: Oberhuber, Martin > > Cc: rxtx at qbang.org > > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > > > I'm wondering what the status is with RXTX locking > > > serial ports on Linux? > > > > > > My understanding is that the mechanism used in > > > 2.1-7r2 (lockfiles) is not really state of the art, and > > > has lots of problems (e.g. missing permissions). > > > > > > There was an idea to migrate towards a Kernel > > > syscall based solution for port locking. > > > > > > What's the status here? > > > > Hi Martin, > > > > I'm in favor of deprecating the current FHS locking mechanism > > in favor of > > an IOCTL when available. I think it will be available on all the > > platforms but do not know for sure. > > > > The status is unchanged. I've had very few free cycles for > > such things. > > Feel free to take a stab at it if you have some time. I > > believe the IOCTL > > is used in the Mac OS X code already. > > > > I don't see any real backwards compatability issues and the > > IOCTL should > > just work. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Mon Apr 28 04:21:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 28 Apr 2008 04:21:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804281928.34454.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: I don't think there would need to be any architectural changes. A couple ifdefs and minor changes in the current code should be enough. Proposal: FHS/UUCP locks: continue to respect them, try to create them but do not error if the IOCTL is supported. (But does the IOCTL being defined mean it will work?) Enumeration: Do not assert the IOCTL while opening. Serial.open: assert the IOCTL after open. Continue to use locks as described above after asserting the IOCTL. If the IOCTL is defined but not working, handle it here. Failure cases include the IOCTL is not supported and the port is already locked. On Mon, 28 Apr 2008, Stephen Davies wrote: > Has anybody done any design work on this? > The first thing that springs to mind is that we still need to check for lock > files because other apps tend to use that approach even if we go to ioctl. > > Cheers, > Stephen Davies > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: >> Thanks Trent. >> >> Problem is only that I'm really not at all >> Familiar with the C part of RXTX. If there >> Were anything I could do in Java for this, >> It would be easier for me.... >> >> ... Are there any C experts here on the list >> Who'd like to look at ioctl port locking >> For linux? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >>> -----Original Message----- >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] >>> Sent: Donnerstag, 24. April 2008 04:32 >>> To: Oberhuber, Martin >>> Cc: rxtx at qbang.org >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? >>> >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: >>>> Dear RXTX community, >>>> >>>> I'm wondering what the status is with RXTX locking >>>> serial ports on Linux? >>>> >>>> My understanding is that the mechanism used in >>>> 2.1-7r2 (lockfiles) is not really state of the art, and >>>> has lots of problems (e.g. missing permissions). >>>> >>>> There was an idea to migrate towards a Kernel >>>> syscall based solution for port locking. >>>> >>>> What's the status here? >>> >>> Hi Martin, >>> >>> I'm in favor of deprecating the current FHS locking mechanism >>> in favor of >>> an IOCTL when available. I think it will be available on all the >>> platforms but do not know for sure. >>> >>> The status is unchanged. I've had very few free cycles for >>> such things. >>> Feel free to take a stab at it if you have some time. I >>> believe the IOCTL >>> is used in the Mac OS X code already. >>> >>> I don't see any real backwards compatability issues and the >>> IOCTL should >>> just work. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Tue Apr 29 12:04:04 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Apr 2008 20:04:04 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Hi all, The biggest problem that I have seen with lockfiles on Linux At least is, that it seems there is no standard with respect To the folder in which they should be created. Also, many Distributions seem to set up file system permissions in such A way that writing to the lockfile folder is not allowed for The normal user -- that's why we stopped using lockfiles In our commercial product. If we are to still respect lockfiles, we first need to Understand where we are expected to look for them. Does Anybody have any insight what variants of lockfile folder Schema exist out there in the wild? Some apps like minicom Seem to even allow users to manually specify a lockfile Folder of their choice. Because of the difficulty finding the right lockfile folder, And because of the inherent risk of thinking that something Might be locked while it actually isn't, I'd suggest that RXTX should have a "soft-off" feature that allows disabling ALL Lockfile checks at runtime without recompiling the native Sharedlibs. Trent - I like your strategy outline, but I think that it Needs to be configurable by the client such that users and/or Customer Support can disable lockfiles / disable ioctl in Case they detect that they are runing on an OS / Kernal that Does not support one or the other. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Montag, 28. April 2008 12:22 > To: Stephen Davies > Cc: rxtx at qbang.org; Oberhuber, Martin; Trent Jarvi > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > I don't think there would need to be any architectural > changes. A couple > ifdefs and minor changes in the current code should be enough. > > Proposal: > > FHS/UUCP locks: > continue to respect them, try to create them but do not error if > the IOCTL is supported. (But does the IOCTL being defined mean > it will work?) > Enumeration: > Do not assert the IOCTL while opening. > Serial.open: > assert the IOCTL after open. Continue to use locks as described > above after asserting the IOCTL. If the IOCTL is defined but > not working, handle it here. Failure cases include the IOCTL > is not supported and the port is already locked. > > On Mon, 28 Apr 2008, Stephen Davies wrote: > > > Has anybody done any design work on this? > > The first thing that springs to mind is that we still need > to check for lock > > files because other apps tend to use that approach even if > we go to ioctl. > > > > Cheers, > > Stephen Davies > > > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > >> Thanks Trent. > >> > >> Problem is only that I'm really not at all > >> Familiar with the C part of RXTX. If there > >> Were anything I could do in Java for this, > >> It would be easier for me.... > >> > >> ... Are there any C experts here on the list > >> Who'd like to look at ioctl port locking > >> For linux? > >> > >> Thanks, > >> -- > >> Martin Oberhuber, Senior Member of Technical Staff, Wind River > >> Target Management Project Lead, DSDP PMC Member > >> http://www.eclipse.org/dsdp/tm > >> > >>> -----Original Message----- > >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] > >>> Sent: Donnerstag, 24. April 2008 04:32 > >>> To: Oberhuber, Martin > >>> Cc: rxtx at qbang.org > >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? > >>> > >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > >>>> Dear RXTX community, > >>>> > >>>> I'm wondering what the status is with RXTX locking > >>>> serial ports on Linux? > >>>> > >>>> My understanding is that the mechanism used in > >>>> 2.1-7r2 (lockfiles) is not really state of the art, and > >>>> has lots of problems (e.g. missing permissions). > >>>> > >>>> There was an idea to migrate towards a Kernel > >>>> syscall based solution for port locking. > >>>> > >>>> What's the status here? > >>> > >>> Hi Martin, > >>> > >>> I'm in favor of deprecating the current FHS locking mechanism > >>> in favor of > >>> an IOCTL when available. I think it will be available on all the > >>> platforms but do not know for sure. > >>> > >>> The status is unchanged. I've had very few free cycles for > >>> such things. > >>> Feel free to take a stab at it if you have some time. I > >>> believe the IOCTL > >>> is used in the Mac OS X code already. > >>> > >>> I don't see any real backwards compatability issues and the > >>> IOCTL should > >>> just work. > >>> > >>> -- > >>> Trent Jarvi > >>> tjarvi at qbang.org > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > From Steffen.DETTMER at ingenico.com Tue Apr 29 13:34:44 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 29 Apr 2008 21:34:44 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Message-ID: <20080429193444.GU2928@elberon.bln.de.ingenico.com> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > The biggest problem that I have seen with lockfiles on Linux > At least is, that it seems there is no standard with respect > To the folder in which they should be created. Also, many > Distributions seem to set up file system permissions in such > A way that writing to the lockfile folder is not allowed for > The normal user -- that's why we stopped using lockfiles > In our commercial product. It seems it depends on the expectations. I consider it as a feature that by default a linux user cannot access serial ports. Maybe root connected a modem (can produce phone bills) or even some serial card reader, maybe with the web servers key pair. I would expect that by default a user cannot open the serial port because of insufficient permissions on the device file. I would expect this on other unices as well (but I don't know it). For windows I think it should be similar but not impacting so much in practice, because often windows users work with big permissions on a somewhat high priviledge level or even Administrator. > If we are to still respect lockfiles, we first need to > Understand where we are expected to look for them. Does > Anybody have any insight what variants of lockfile folder > Schema exist out there in the wild? Some apps like minicom > Seem to even allow users to manually specify a lockfile > Folder of their choice. At least my (ancient) minicom does not allow the user to change this option, it is displayed but read-only, but root is allowed to change it. > Because of the difficulty finding the right lockfile folder, > And because of the inherent risk of thinking that something > Might be locked while it actually isn't, I'd suggest that > RXTX should have a "soft-off" feature that allows disabling > ALL Lockfile checks at runtime without recompiling the native > Sharedlibs. sounds very reasonable, yes... and as admin I would not wish that users could skip such locking because they do things wrong by default ;) (in the end I guess that is related to the dilemma, that hotplug/user-owned-periphery and multi-user systems simply conflict) > Trent - I like your strategy outline, but I think that it > Needs to be configurable by the client such that users and/or > Customer Support can disable lockfiles / disable ioctl in > Case they detect that they are runing on an OS / Kernal that > Does not support one or the other. Yes, this would be good I guess... Applications could offer configuration options to control that, maybe similarily as minicom. BTW, man minicom tells: *B - Lock file location On most systems This should be /usr/spool/uucp. Linux systems use /var/lock. If this directory does not exist, minicom will not attempt to use lockfiles. The statement `Linux systems use /var/lock' is interesting, does anyone know the source of this convention? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Tue Apr 29 16:11:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Apr 2008 16:11:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? These details are outlined in the Filesystem Hierarchy Standard (FHS). http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLOCKLOCKFILES -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Tue Apr 29 18:58:09 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Wed, 30 Apr 2008 10:28:09 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: <200804301028.09307.scldad@sdc.com.au> I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is the same. Any ideas as to how to handle this? Stephen On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: > * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > > The biggest problem that I have seen with lockfiles on Linux > > At least is, that it seems there is no standard with respect > > To the folder in which they should be created. Also, many > > Distributions seem to set up file system permissions in such > > A way that writing to the lockfile folder is not allowed for > > The normal user -- that's why we stopped using lockfiles > > In our commercial product. > > It seems it depends on the expectations. I consider it as a > feature that by default a linux user cannot access serial ports. > Maybe root connected a modem (can produce phone bills) or even > some serial card reader, maybe with the web servers key pair. > > I would expect that by default a user cannot open the serial port > because of insufficient permissions on the device file. I would > expect this on other unices as well (but I don't know it). > > For windows I think it should be similar but not impacting so > much in practice, because often windows users work with big > permissions on a somewhat high priviledge level or even > Administrator. > > > If we are to still respect lockfiles, we first need to > > Understand where we are expected to look for them. Does > > Anybody have any insight what variants of lockfile folder > > Schema exist out there in the wild? Some apps like minicom > > Seem to even allow users to manually specify a lockfile > > Folder of their choice. > > At least my (ancient) minicom does not allow the user to change > this option, it is displayed but read-only, but root is allowed > to change it. > > > Because of the difficulty finding the right lockfile folder, > > And because of the inherent risk of thinking that something > > Might be locked while it actually isn't, I'd suggest that > > RXTX should have a "soft-off" feature that allows disabling > > ALL Lockfile checks at runtime without recompiling the native > > Sharedlibs. > > sounds very reasonable, yes... > and as admin I would not wish that users could skip such > locking because they do things wrong by default ;) > > (in the end I guess that is related to the dilemma, that > hotplug/user-owned-periphery and multi-user systems simply > conflict) > > > Trent - I like your strategy outline, but I think that it > > Needs to be configurable by the client such that users and/or > > Customer Support can disable lockfiles / disable ioctl in > > Case they detect that they are runing on an OS / Kernal that > > Does not support one or the other. > > Yes, this would be good I guess... Applications could offer > configuration options to control that, maybe similarily as > minicom. > > BTW, man minicom tells: > > *B - Lock file location > On most systems This should be /usr/spool/uucp. > Linux systems use /var/lock. If this directory > does not exist, minicom will not attempt to use > lockfiles. > > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure > and expedient electronic transaction acceptance. Ingenico products leverage > proven technology, established standards and unparalleled ergonomics to > provide optimal reliability, versatility and usability. This comprehensive > range of products is complemented by a global array of services and > partnerships, enabling businesses in a number of vertical sectors to accept > transactions anywhere their business takes them. www.ingenico.com This > message may contain confidential and/or privileged information. If you are > not the addressee or authorized to receive this for the addressee, you must > not use, copy, disclose or take any action based on this message or any > information herein. If you have received this message in error, please > advise the sender immediately by reply e-mail and delete this message. > Thank you for your cooperation. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Wed Apr 30 19:30:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 30 Apr 2008 19:30:51 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804301028.09307.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> <200804301028.09307.scldad@sdc.com.au> Message-ID: Hi Stephen, I suspect ioctl/TIOCEXCL open/O_EXCL would do the job. Mac uses TIOCEXCL and it is POSIX. We use O_EXCL for lockfiles on Linux already. On Wed, 30 Apr 2008, Stephen Davies wrote: > I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is > the same. > > Any ideas as to how to handle this? > > Stephen > > > On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: >> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: >>> The biggest problem that I have seen with lockfiles on Linux >>> At least is, that it seems there is no standard with respect >>> To the folder in which they should be created. Also, many >>> Distributions seem to set up file system permissions in such >>> A way that writing to the lockfile folder is not allowed for >>> The normal user -- that's why we stopped using lockfiles >>> In our commercial product. >> >> It seems it depends on the expectations. I consider it as a >> feature that by default a linux user cannot access serial ports. >> Maybe root connected a modem (can produce phone bills) or even >> some serial card reader, maybe with the web servers key pair. >> >> I would expect that by default a user cannot open the serial port >> because of insufficient permissions on the device file. I would >> expect this on other unices as well (but I don't know it). >> >> For windows I think it should be similar but not impacting so >> much in practice, because often windows users work with big >> permissions on a somewhat high priviledge level or even >> Administrator. >> >>> If we are to still respect lockfiles, we first need to >>> Understand where we are expected to look for them. Does >>> Anybody have any insight what variants of lockfile folder >>> Schema exist out there in the wild? Some apps like minicom >>> Seem to even allow users to manually specify a lockfile >>> Folder of their choice. >> >> At least my (ancient) minicom does not allow the user to change >> this option, it is displayed but read-only, but root is allowed >> to change it. >> >>> Because of the difficulty finding the right lockfile folder, >>> And because of the inherent risk of thinking that something >>> Might be locked while it actually isn't, I'd suggest that >>> RXTX should have a "soft-off" feature that allows disabling >>> ALL Lockfile checks at runtime without recompiling the native >>> Sharedlibs. >> >> sounds very reasonable, yes... >> and as admin I would not wish that users could skip such >> locking because they do things wrong by default ;) >> >> (in the end I guess that is related to the dilemma, that >> hotplug/user-owned-periphery and multi-user systems simply >> conflict) >> >>> Trent - I like your strategy outline, but I think that it >>> Needs to be configurable by the client such that users and/or >>> Customer Support can disable lockfiles / disable ioctl in >>> Case they detect that they are runing on an OS / Kernal that >>> Does not support one or the other. >> >> Yes, this would be good I guess... Applications could offer >> configuration options to control that, maybe similarily as >> minicom. >> >> BTW, man minicom tells: >> >> *B - Lock file location >> On most systems This should be /usr/spool/uucp. >> Linux systems use /var/lock. If this directory >> does not exist, minicom will not attempt to use >> lockfiles. >> >> The statement `Linux systems use /var/lock' is interesting, does >> anyone know the source of this convention? >> >> oki, >> >> Steffen >> >> About Ingenico Throughout the world businesses rely on Ingenico for secure >> and expedient electronic transaction acceptance. Ingenico products leverage >> proven technology, established standards and unparalleled ergonomics to >> provide optimal reliability, versatility and usability. This comprehensive >> range of products is complemented by a global array of services and >> partnerships, enabling businesses in a number of vertical sectors to accept >> transactions anywhere their business takes them. www.ingenico.com This >> message may contain confidential and/or privileged information. If you are >> not the addressee or authorized to receive this for the addressee, you must >> not use, copy, disclose or take any action based on this message or any >> information herein. If you have received this message in error, please >> advise the sender immediately by reply e-mail and delete this message. >> Thank you for your cooperation. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0070.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0068.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0055.html From pboulton at pulsetracer.com Fri Apr 18 14:30:13 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Fri, 18 Apr 2008 13:30:13 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site Message-ID: <480904D5.1060307@pulsetracer.com> Hello, gentle serial porters. I have downloaded the zipped up binaries for use on Windows without Sun's CommAPI, but don't seem able to extract anything from the download. Go to main page, http://www.rxtx.org/ Click on Downloads I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) And I save it to disk. If I try and extract the files with WinZip, Winzip thinks the archive is corrupt. If I try using Windows Explorer, I am able to extract it into a single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than the original .zip. Any help would be much appreciated. Sincerely, Philip Boulton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080418/97d89793/attachment-0053.html From tjarvi at qbang.org Fri Apr 18 19:07:00 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 18 Apr 2008 19:07:00 -0600 (MDT) Subject: [Rxtx] Difficulty opening zip file at rxtx site In-Reply-To: <480904D5.1060307@pulsetracer.com> References: <480904D5.1060307@pulsetracer.com> Message-ID: On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org From pboulton at pulsetracer.com Sat Apr 19 12:46:26 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Sat, 19 Apr 2008 11:46:26 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site References: <480904D5.1060307@pulsetracer.com> Message-ID: <53DB7576450695419E09299104043761A78533@ZTGSERVER.ztg.local> I have been able to get my hands on the binaries, by going to the ftp directory /pub/rxtx at ftp.qbang.org,, and ftping the file rxtx-2.1-7-bins-r2.zip . This opens happily with Winzip, and extracts as the set of files that you describe below. I only experience the ill-formed archive problem by clicking the link on the rxtx.org Downloads page (http://rxtx.qbang.org/pub/rxtx/ rxtx-2.1-7-bins-r2.zip ). Not sure what to make of that. Philip Boulton ________________________________ From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Fri 4/18/2008 6:07 PM To: Philip Boulton Cc: rxtx at qbang.org Subject: Re: [Rxtx] Difficulty opening zip file at rxtx site On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080419/147923bb/attachment-0052.html From jlar310 at gmail.com Sat Apr 19 19:11:55 2008 From: jlar310 at gmail.com (Jeff Larsen) Date: Sat, 19 Apr 2008 20:11:55 -0500 Subject: [Rxtx] Moxa serial over Ethernet driver Message-ID: Hi all, I've been using javax.comm for years to communicate with a legacy radio data system. We want to migrate the java side of the system to a VMware Server virtual machine. We've had great success using Moxa DE-303 and 5610 serial over Ethernet appliances and virtual machines for running hylafax. The OS (Linux in this case) uses a kernel driver to communicate with the Moxa via a virtual serial port such as /dev/ttyr00. I want to do the same thing with javax.comm or gnu.io to connect to a virtual serial port. However I'm hitting road blocks everywhere. javax.comm for Linux sees the virtual port, but there are transmission errors. Tried Solaris too, but the Solaris Moxa drivers don't play nice with javax.comm because the driver uses /dev/pts/n instead of /dev/term/x. Next I tried RXTX on Linux, but I'm getting NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX on Solaris. Has anyone used RXTX with serial over Ethernet devices? Any hints on how to make it work? I know that I'm not completely off track because javax.comm does work with Moxa on a Windows platform, but that's just not an option for production deployment. -- Jeff From tjarvi at qbang.org Sat Apr 19 21:08:41 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 19 Apr 2008 21:08:41 -0600 (MDT) Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: yOn Sat, 19 Apr 2008, Jeff Larsen wrote: > Hi all, > > I've been using javax.comm for years to communicate with a legacy > radio data system. We want to migrate the java side of the system to a > VMware Server virtual machine. We've had great success using Moxa > DE-303 and 5610 serial over Ethernet appliances and virtual machines > for running hylafax. The OS (Linux in this case) uses a kernel driver > to communicate with the Moxa via a virtual serial port such as > /dev/ttyr00. > > I want to do the same thing with javax.comm or gnu.io to connect to a > virtual serial port. However I'm hitting road blocks everywhere. > javax.comm for Linux sees the virtual port, but there are transmission > errors. Tried Solaris too, but the Solaris Moxa drivers don't play > nice with javax.comm because the driver uses /dev/pts/n instead of > /dev/term/x. Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris. > > Has anyone used RXTX with serial over Ethernet devices? Any hints on > how to make it work? > > I know that I'm not completely off track because javax.comm does work > with Moxa on a Windows platform, but that's just not an option for > production deployment. > > Moxa should work under linux. There may be minor issues depending upon how complete the kernel driver is but I think it will work. One of the minor issues is /dev/ttyr00 is not enumerated. There are several work arounds documented with the source code and on the wiki. The easiest solution for testing purposes is to make a symbolic link from /dev/ttyr00 to a port that is enumerated such as /dev/ttyS129. You can later alter the rxtx source or use properties to change the enumerated ports. -- Trent Jarvi tjarvi at qbang.org From d.tonhofer at m-plify.com Sun Apr 20 03:33:30 2008 From: d.tonhofer at m-plify.com (David Tonhofer (M-PLIFY S.A.)) Date: Sun, 20 Apr 2008 11:33:30 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: <480B0DEA.5010908@m-plify.com> Jeff Larsen wrote: > Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris It might be that the Java side of RXTX does not recognize that portname. Trying modifying src/RXTXCommDriver.java as described in this case: http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card From ajmas at sympatico.ca Sun Apr 20 16:37:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Apr 2008 18:37:59 -0400 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <480B0DEA.5010908@m-plify.com> References: <480B0DEA.5010908@m-plify.com> Message-ID: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > Jeff Larsen wrote: >> Next I tried RXTX on Linux, but I'm getting >> NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX >> on Solaris > It might be that the Java side of RXTX does not recognize that > portname. > Trying modifying src/RXTXCommDriver.java as described in this case: > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card I wonder whether it would be worth allowing custom port prefixes as a system parameter? For example: gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" Andre From Martin.Oberhuber at windriver.com Tue Apr 22 12:34:36 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 22 Apr 2008 20:34:36 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> References: <480B0DEA.5010908@m-plify.com> <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE6485848056CD6CE@ism-mail03.corp.ad.wrs.com> Sounds like a great idea... I'm wondering how the "variable part" after the Prefixes could be specified though? What about allowing Regular Expression character Classes in the existing System Property for specifying ports: System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyS[0-9],ttyS[ABC],ttyUSB[0-9a-z]"); The set of allowed patterns would of course need to Be restricted compared to REGEX, because it must be A syntax that supports iterating over it. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Montag, 21. April 2008 00:38 > To: rxtx at qbang.org and Users > Subject: Re: [Rxtx] Moxa serial over Ethernet driver > > > On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > > Jeff Larsen wrote: > >> Next I tried RXTX on Linux, but I'm getting > >> NoSuchPortException connecting to /dev/ttyr00. I have yet > to try RXTX > >> on Solaris > > It might be that the Java side of RXTX does not recognize that > > portname. > > Trying modifying src/RXTXCommDriver.java as described in this case: > > > > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_ > SST-4P.2FLP_multiport_card > > I wonder whether it would be worth allowing custom port > prefixes as a > system parameter? For > example: > > gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Loi.TRAN at weatherford.com Tue Apr 22 13:10:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Tue, 22 Apr 2008 14:10:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled Message-ID: Hi, I'm currently using the Java RXTX API to interface to a serial port. The serial port is connected to a bridge board that communicates with our communications system running at 1.875 Mbps which is linked to an embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no flow control). I send a command to the embedded board through the serial-bridge board which then is relayed to the embedded board. The command sent asks the embedded board to dump a binary image. Here's where I'm hitting some problems. I've successfully done this is an integrated serial port from the laptop. The binary file that comes back is consistent on every attempt. When I use the application I've written to do the same thing with a USB-to-serial adapter, the image I get back is not the same as the image I receive through the USB-to-serial adapter is not consistent at all. A final thing is that when I use a terminal program to dump the binary image with the USB-serial adapter, the image is correct. Every time! What is the terminal program doing that's not being done in my application? My application is quite simple. Has anyone observed this behavior before? If you have, I'd like to know how you've gotten around this problem. Thanks, LT =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From tjarvi at qbang.org Tue Apr 22 21:11:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 22 Apr 2008 21:11:10 -0600 (MDT) Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org From Loi.TRAN at weatherford.com Wed Apr 23 08:35:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Wed, 23 Apr 2008 09:35:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: Thanks for all the responses. I finally tried something that worked consistently. I updated my Prolific driver and repeated my tests. It worked. If you're using the Prolific type USB-serial adapters, do no use the Prolific version 2.0.2.1 driver on Windows. Update it to the latest 2.0.2.8 version. Again, thanks for all the responses. LT -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Tuesday, April 22, 2008 10:11 PM To: TRAN, Loi X. Cc: rxtx at qbang.org Subject: Re: [Rxtx] Prolific USB - RXTX data mangled On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From Martin.Oberhuber at windriver.com Wed Apr 23 18:54:26 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 02:54:26 +0200 Subject: [Rxtx] RXTX port locking on Linux status? Message-ID: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Dear RXTX community, I'm wondering what the status is with RXTX locking serial ports on Linux? My understanding is that the mechanism used in 2.1-7r2 (lockfiles) is not really state of the art, and has lots of problems (e.g. missing permissions). There was an idea to migrate towards a Kernel syscall based solution for port locking. What's the status here? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/9878db9f/attachment-0048.html From tjarvi at qbang.org Wed Apr 23 20:32:24 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Apr 2008 20:32:24 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > Dear RXTX community, > > I'm wondering what the status is with RXTX locking > serial ports on Linux? > > My understanding is that the mechanism used in > 2.1-7r2 (lockfiles) is not really state of the art, and > has lots of problems (e.g. missing permissions). > > There was an idea to migrate towards a Kernel > syscall based solution for port locking. > > What's the status here? > Hi Martin, I'm in favor of deprecating the current FHS locking mechanism in favor of an IOCTL when available. I think it will be available on all the platforms but do not know for sure. The status is unchanged. I've had very few free cycles for such things. Feel free to take a stab at it if you have some time. I believe the IOCTL is used in the Mac OS X code already. I don't see any real backwards compatability issues and the IOCTL should just work. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Apr 24 06:14:06 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 14:14:06 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Thanks Trent. Problem is only that I'm really not at all Familiar with the C part of RXTX. If there Were anything I could do in Java for this, It would be easier for me.... ... Are there any C experts here on the list Who'd like to look at ioctl port locking For linux? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Donnerstag, 24. April 2008 04:32 > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > I'm wondering what the status is with RXTX locking > > serial ports on Linux? > > > > My understanding is that the mechanism used in > > 2.1-7r2 (lockfiles) is not really state of the art, and > > has lots of problems (e.g. missing permissions). > > > > There was an idea to migrate towards a Kernel > > syscall based solution for port locking. > > > > What's the status here? > > > > Hi Martin, > > I'm in favor of deprecating the current FHS locking mechanism > in favor of > an IOCTL when available. I think it will be available on all the > platforms but do not know for sure. > > The status is unchanged. I've had very few free cycles for > such things. > Feel free to take a stab at it if you have some time. I > believe the IOCTL > is used in the Mac OS X code already. > > I don't see any real backwards compatability issues and the > IOCTL should > just work. > > -- > Trent Jarvi > tjarvi at qbang.org > From sspies at sloc.de Thu Apr 24 07:15:36 2008 From: sspies at sloc.de (Sebastian Spies) Date: Thu, 24 Apr 2008 15:15:36 +0200 (CEST) Subject: [Rxtx] rxtx on gumstix: Interrupted system call In-Reply-To: <47FB7B20.7080504@sloc.de> References: <47FB7B20.7080504@sloc.de> Message-ID: <55445.130.83.139.205.1209042936.squirrel@ssl.sloc.de> Dear list, while porting rxtx to the gumstix, I found out, that select used in readArray in SerialImp.c might not work as expected. Maybe, because of missing TIOCSERGETLSR-support? select is often interrupted, so i wrote the following quick'n'dirty hack to make it work on gumstix: diff -Nur rxtx-2.1-7r2/src/SerialImp.c rxtx-2.1-7r2/src/SerialImp.c --- rxtx-2.1-7r2/src/SerialImp.c 2006-01-29 23:19:04.000000000 +0100 +++ rxtx-2.1-7r2-patched/src/SerialImp.c 2008-04-24 14:30:17.000000000 +0200 @@ -3380,7 +3381,7 @@ JNIEXPORT jint JNICALL RXTXPort(readArray)( JNIEnv *env, jobject jobj, jbyteArray jbarray, jint offset, jint length ) { - int bytes; + int bytes = 0; jbyte *body; /* char msg[80]; */ int fd = get_java_var( env, jobj, "fd", "I" ); @@ -3397,9 +3398,18 @@ "readArray", "Invalid length" ); return -1; } - body = (*env)->GetByteArrayElements( env, jbarray, 0 ); - bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ - (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + while(1 > bytes) + { + body = (*env)->GetByteArrayElements( env, jbarray, 0 ); + bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ + (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + // quick'n'dirty - SSP + report (" trying again... \n"); + errno = 0; + } + if( bytes < 0 ) { report( "RXTXPort:readArray bytes < 0" ); LEAVE( "RXTXPort:readArray" ); > Hey, > > I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use > RXTXPort$SerialInputStream.read(), then I get the following Exception. I > did not yet figure out which system call is interrupted as strace > produces loads of output. > > Any help would be very appreciated. Thanks in advance. > Sebastian > > > [java] java.io.IOException: Interrupted system call in readArray > [java] at gnu.io.RXTXPort.readArray(Native Method) > [java] at > gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) > [java] at > java.io.FilterInputStream.read(FilterInputStream.java:189) > [java] at > java.io.BufferedInputStream.refill(BufferedInputStream.java:371) > [java] at > java.io.BufferedInputStream.read(BufferedInputStream.java:229) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) > [java] at > com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) > > -- > Sebastian Spies > > mail: sspies at sloc.de > > > > From fire_baptized at hotmail.com Thu Apr 24 18:27:48 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Thu, 24 Apr 2008 20:27:48 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hello I am having a problem with the serial device connecting (software wise) to the serial port. However I have a test program and it seems to work just fine in that environment - and it doesnt use GUI. The error I am getting is : PortNotFoundException Now the way I have it setup in the GUI environment is that once the user pushes a JButton the program connects using this class: protected void establishConnection() { try { portId = CommPortIdentifier.getPortIdentifier("COM3"); System.out.println("Establishing connction....."); messages[0] = "\nEstablishing connction.....\n"; } catch ( NoSuchPortException noport) { System.out.println("Port not found: "+ noport); messages[0] = "Port not found: "+ noport+"\n"; } try { serialPort = (SerialPort) portId.open("serial", 50); System.out.println("Port has been found."); messages[1] = "Port has been found.\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[1] = "" +usedport; } try { serialPort = (SerialPort) portId.open("serial", 50); messages[2] = "Connecting to COM3 on port 50....\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; } try { serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); System.out.println("Esablishing the transfer rate settings for COM3."); messages[3] = "Esablishing the transfer rate settings for COM3.\n"; } catch (UnsupportedCommOperationException nosupcom) { System.out.println(nosupcom); System.out.println("The tranfer rate could not be esblished on COM3."); messages[3] = "The tranfer rate could not be esblished on COM3.\n"; } System.out.println(serialPort.getFlowControlMode()); messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; //sendDataOut(buffer[3],buffer[4]); } I need all the data in this method (and all the string values in this method) to be printed out on a JTextArea. I wont do me any good if not all the text is printed on a JTextArea in another class. So I have the text printing the JTextArea correctly, but everytime the JButton is activated - it gives me that error message. I did add a disconnect button that is supposed to call the serialPort.close(). _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/273fd4ec/attachment-0047.html From tjarvi at qbang.org Thu Apr 24 21:54:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Apr 2008 21:54:10 -0600 (MDT) Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > Hello I am having a problem with the serial device connecting (software > wise) to the serial port. However I have a test program and it seems to > work just fine in that environment - and it doesnt use GUI. The error I > am getting is : PortNotFoundException Now the way I have it setup in the > GUI environment is that once the user pushes a JButton the program > connects using this class: > > protected void establishConnection() { > try { > portId = CommPortIdentifier.getPortIdentifier("COM3"); > System.out.println("Establishing connction....."); > messages[0] = "\nEstablishing connction.....\n"; > } > catch ( NoSuchPortException noport) { > System.out.println("Port not found: "+ noport); > messages[0] = "Port not found: "+ noport+"\n"; > } > try { > serialPort = (SerialPort) portId.open("serial", 50); > System.out.println("Port has been found."); > messages[1] = "Port has been found.\n"; > } > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[1] = "" +usedport; > } ================================================================= > try { > serialPort = (SerialPort) portId.open("serial", 50); > messages[2] = "Connecting to COM3 on port 50....\n"; > } ================================================================== > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > } > try { > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > System.out.println("Esablishing the transfer rate settings for COM3."); > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > } > catch (UnsupportedCommOperationException nosupcom) { > System.out.println(nosupcom); > System.out.println("The tranfer rate could not be esblished on COM3."); > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > } > System.out.println(serialPort.getFlowControlMode()); > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > //sendDataOut(buffer[3],buffer[4]); > } > > I need all the data in this method (and all the string values in this > method) to be printed out on a JTextArea. I wont do me any good if not > all the text is printed on a JTextArea in another class. So I have the > text printing the JTextArea correctly, but everytime the JButton is > activated - it gives me that error message. I did add a disconnect > button that is supposed to call the serialPort.close(). > The open code used twice is going to throw an exception. It may be that you catch the exception above this code and print a confusing message? A common mistake is people will accidently run two copies of their program. The first instance of the program will open the port and prevent enumeration (finding the port) in the second instance of the program. As an example, you may be running your text based application which is preventing the GUI from seeing the port. Enumeration is done by trying to open the port. If the port is open, Enumeration fails. -- Trent Jarvi tjarvi at qbang.org From fire_baptized at hotmail.com Thu Apr 24 22:32:05 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 00:32:05 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Wow - thanks dude what a dumb thing for me to not catch..... now here is the current problem - right now I am trying to output data again one is with the test program - and it seems that serialPort.setRTS(true); is throwing an exceptions there - now if I show this code please bare in mind that I am only testing - the code is kinda sloppy in my mind - but if I can figure out why calling this function is throwing an exception then maybe I can figure out why my GUI application is getting the same null pointer exceptions when try to send out the data stream. FYI Trent this email is not directed towards you - anyone can jump in on this public static void main(String args[]) { byte[] b = new byte[64]; int keyinput = 0 ; byte x = 0; byte y = 0; PortTesting1 testports = new PortTesting1(); try { joyskoro = Joystick.createInstance(); } catch (IOException ioexc) { System.out.println("There is an input/output problem: " + ioexc); } while (true) { joyskoro.poll(); b[0] = ((byte) -(10 * joyskoro.getY())); b[1] = ((byte) (10 * joyskoro.getX())); System.out.println("The 3rd byte is: " +b[0]); System.out.println("The 4rd byte is: " +b[1]); serialPort.setRTS(true); // HERE IS WHERE THE PROBLEM IS !!!!!!! ON THIS LINE but if I dont have it active in my program the Bluetooth device (that is System.out.println("Ready to send :-) !"); //connected to the serial port does not send out data!!!!! if (joyskoro.isButtonDown(joyskoro.BUTTON10)) { System.out.println("Connection terminated."); serialPort.close(); break; } if (joyskoro.isButtonDown(joyskoro.BUTTON2)) { boolean flag = true; //reading from key input from the keyboard System.out.println("Please input a command: "); while (flag) { try { keyinput = System.in.read(); } catch (IOException ioexc) {/*there is no need to put * anything here */ } if((char)keyinput=='w') { pushIt((byte)85); } if((char)keyinput=='s') { pushIt((byte)84); } if((char)keyinput=='a') { pushIt((byte)83); } if((char)keyinput=='d') { pushIt((byte)82); } if((char)keyinput=='q') { pushIt((byte)89); } if((char)keyinput=='\t') { //this stop reading input from the keyboard flag = false; } } and help anyways here is the block of code that throwing an exception for the test program: > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/5c8f7d68/attachment-0047.html From fire_baptized at hotmail.com Fri Apr 25 07:59:53 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 09:59:53 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Are there any examples of how to push out data? As in using input and output streams - if I can compare code maybe I can see where this is causing a problem. I have a byte array that I am pushing out data. I keep getting null pointer exceptions every where I turn. > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/22228ab6/attachment-0046.html From ajmas at sympatico.ca Sat Apr 26 07:37:09 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 26 Apr 2008 09:37:09 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hi, On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote: > > Are there any examples of how to push out data? As in using input > and output streams - if I can compare code maybe I can see where > this is causing a problem. I have a byte array that I am pushing > out data. I keep getting null pointer exceptions every where I turn. > There are some examples here that might be of help: http://rxtx.qbang.org/wiki/index.php/Examples Andre From fire_baptized at hotmail.com Sat Apr 26 20:13:54 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Sat, 26 Apr 2008 22:13:54 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: looked at those....yep didnt help - I need to push out data with GUI and not get a null pointer exception everytime I try. > CC: rxtx at qbang.org> From: ajmas at sympatico.ca> To: fire_baptized at hotmail.com> Subject: Re: [Rxtx] Serial Problems with Gui.....> Date: Sat, 26 Apr 2008 09:37:09 -0400> > Hi,> > > On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote:> >> > Are there any examples of how to push out data? As in using input > > and output streams - if I can compare code maybe I can see where > > this is causing a problem. I have a byte array that I am pushing > > out data. I keep getting null pointer exceptions every where I turn.> >> > There are some examples here that might be of help:> > http://rxtx.qbang.org/wiki/index.php/Examples> > Andre _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080426/09f95b41/attachment-0045.html From michael.erskine at ketech.com Mon Apr 28 02:47:22 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 28 Apr 2008 09:47:22 +0100 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D426EF3CBBC5@no-sv-03.ketech.local> Jesrael D. Summerhill wrote: > looked at those....yep didnt help - I need to push out data with GUI and > not get a null pointer exception everytime I try. So it seems pretty obvious that your code needs to check for nulls wherever one may occur and report what's happening. Alternatively, catch the npe and display the stack trace. Then you can fix your code so it doesn't try to work with something that ain't there. Regards, Michael Erskine. From scldad at sdc.com.au Mon Apr 28 03:58:34 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Mon, 28 Apr 2008 19:28:34 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Message-ID: <200804281928.34454.scldad@sdc.com.au> Has anybody done any design work on this? The first thing that springs to mind is that we still need to check for lock files because other apps tend to use that approach even if we go to ioctl. Cheers, Stephen Davies On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > Thanks Trent. > > Problem is only that I'm really not at all > Familiar with the C part of RXTX. If there > Were anything I could do in Java for this, > It would be easier for me.... > > ... Are there any C experts here on the list > Who'd like to look at ioctl port locking > For linux? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > -----Original Message----- > > From: Trent Jarvi [mailto:tjarvi at qbang.org] > > Sent: Donnerstag, 24. April 2008 04:32 > > To: Oberhuber, Martin > > Cc: rxtx at qbang.org > > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > > > I'm wondering what the status is with RXTX locking > > > serial ports on Linux? > > > > > > My understanding is that the mechanism used in > > > 2.1-7r2 (lockfiles) is not really state of the art, and > > > has lots of problems (e.g. missing permissions). > > > > > > There was an idea to migrate towards a Kernel > > > syscall based solution for port locking. > > > > > > What's the status here? > > > > Hi Martin, > > > > I'm in favor of deprecating the current FHS locking mechanism > > in favor of > > an IOCTL when available. I think it will be available on all the > > platforms but do not know for sure. > > > > The status is unchanged. I've had very few free cycles for > > such things. > > Feel free to take a stab at it if you have some time. I > > believe the IOCTL > > is used in the Mac OS X code already. > > > > I don't see any real backwards compatability issues and the > > IOCTL should > > just work. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Mon Apr 28 04:21:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 28 Apr 2008 04:21:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804281928.34454.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: I don't think there would need to be any architectural changes. A couple ifdefs and minor changes in the current code should be enough. Proposal: FHS/UUCP locks: continue to respect them, try to create them but do not error if the IOCTL is supported. (But does the IOCTL being defined mean it will work?) Enumeration: Do not assert the IOCTL while opening. Serial.open: assert the IOCTL after open. Continue to use locks as described above after asserting the IOCTL. If the IOCTL is defined but not working, handle it here. Failure cases include the IOCTL is not supported and the port is already locked. On Mon, 28 Apr 2008, Stephen Davies wrote: > Has anybody done any design work on this? > The first thing that springs to mind is that we still need to check for lock > files because other apps tend to use that approach even if we go to ioctl. > > Cheers, > Stephen Davies > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: >> Thanks Trent. >> >> Problem is only that I'm really not at all >> Familiar with the C part of RXTX. If there >> Were anything I could do in Java for this, >> It would be easier for me.... >> >> ... Are there any C experts here on the list >> Who'd like to look at ioctl port locking >> For linux? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >>> -----Original Message----- >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] >>> Sent: Donnerstag, 24. April 2008 04:32 >>> To: Oberhuber, Martin >>> Cc: rxtx at qbang.org >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? >>> >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: >>>> Dear RXTX community, >>>> >>>> I'm wondering what the status is with RXTX locking >>>> serial ports on Linux? >>>> >>>> My understanding is that the mechanism used in >>>> 2.1-7r2 (lockfiles) is not really state of the art, and >>>> has lots of problems (e.g. missing permissions). >>>> >>>> There was an idea to migrate towards a Kernel >>>> syscall based solution for port locking. >>>> >>>> What's the status here? >>> >>> Hi Martin, >>> >>> I'm in favor of deprecating the current FHS locking mechanism >>> in favor of >>> an IOCTL when available. I think it will be available on all the >>> platforms but do not know for sure. >>> >>> The status is unchanged. I've had very few free cycles for >>> such things. >>> Feel free to take a stab at it if you have some time. I >>> believe the IOCTL >>> is used in the Mac OS X code already. >>> >>> I don't see any real backwards compatability issues and the >>> IOCTL should >>> just work. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Tue Apr 29 12:04:04 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Apr 2008 20:04:04 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Hi all, The biggest problem that I have seen with lockfiles on Linux At least is, that it seems there is no standard with respect To the folder in which they should be created. Also, many Distributions seem to set up file system permissions in such A way that writing to the lockfile folder is not allowed for The normal user -- that's why we stopped using lockfiles In our commercial product. If we are to still respect lockfiles, we first need to Understand where we are expected to look for them. Does Anybody have any insight what variants of lockfile folder Schema exist out there in the wild? Some apps like minicom Seem to even allow users to manually specify a lockfile Folder of their choice. Because of the difficulty finding the right lockfile folder, And because of the inherent risk of thinking that something Might be locked while it actually isn't, I'd suggest that RXTX should have a "soft-off" feature that allows disabling ALL Lockfile checks at runtime without recompiling the native Sharedlibs. Trent - I like your strategy outline, but I think that it Needs to be configurable by the client such that users and/or Customer Support can disable lockfiles / disable ioctl in Case they detect that they are runing on an OS / Kernal that Does not support one or the other. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Montag, 28. April 2008 12:22 > To: Stephen Davies > Cc: rxtx at qbang.org; Oberhuber, Martin; Trent Jarvi > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > I don't think there would need to be any architectural > changes. A couple > ifdefs and minor changes in the current code should be enough. > > Proposal: > > FHS/UUCP locks: > continue to respect them, try to create them but do not error if > the IOCTL is supported. (But does the IOCTL being defined mean > it will work?) > Enumeration: > Do not assert the IOCTL while opening. > Serial.open: > assert the IOCTL after open. Continue to use locks as described > above after asserting the IOCTL. If the IOCTL is defined but > not working, handle it here. Failure cases include the IOCTL > is not supported and the port is already locked. > > On Mon, 28 Apr 2008, Stephen Davies wrote: > > > Has anybody done any design work on this? > > The first thing that springs to mind is that we still need > to check for lock > > files because other apps tend to use that approach even if > we go to ioctl. > > > > Cheers, > > Stephen Davies > > > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > >> Thanks Trent. > >> > >> Problem is only that I'm really not at all > >> Familiar with the C part of RXTX. If there > >> Were anything I could do in Java for this, > >> It would be easier for me.... > >> > >> ... Are there any C experts here on the list > >> Who'd like to look at ioctl port locking > >> For linux? > >> > >> Thanks, > >> -- > >> Martin Oberhuber, Senior Member of Technical Staff, Wind River > >> Target Management Project Lead, DSDP PMC Member > >> http://www.eclipse.org/dsdp/tm > >> > >>> -----Original Message----- > >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] > >>> Sent: Donnerstag, 24. April 2008 04:32 > >>> To: Oberhuber, Martin > >>> Cc: rxtx at qbang.org > >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? > >>> > >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > >>>> Dear RXTX community, > >>>> > >>>> I'm wondering what the status is with RXTX locking > >>>> serial ports on Linux? > >>>> > >>>> My understanding is that the mechanism used in > >>>> 2.1-7r2 (lockfiles) is not really state of the art, and > >>>> has lots of problems (e.g. missing permissions). > >>>> > >>>> There was an idea to migrate towards a Kernel > >>>> syscall based solution for port locking. > >>>> > >>>> What's the status here? > >>> > >>> Hi Martin, > >>> > >>> I'm in favor of deprecating the current FHS locking mechanism > >>> in favor of > >>> an IOCTL when available. I think it will be available on all the > >>> platforms but do not know for sure. > >>> > >>> The status is unchanged. I've had very few free cycles for > >>> such things. > >>> Feel free to take a stab at it if you have some time. I > >>> believe the IOCTL > >>> is used in the Mac OS X code already. > >>> > >>> I don't see any real backwards compatability issues and the > >>> IOCTL should > >>> just work. > >>> > >>> -- > >>> Trent Jarvi > >>> tjarvi at qbang.org > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > From Steffen.DETTMER at ingenico.com Tue Apr 29 13:34:44 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 29 Apr 2008 21:34:44 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Message-ID: <20080429193444.GU2928@elberon.bln.de.ingenico.com> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > The biggest problem that I have seen with lockfiles on Linux > At least is, that it seems there is no standard with respect > To the folder in which they should be created. Also, many > Distributions seem to set up file system permissions in such > A way that writing to the lockfile folder is not allowed for > The normal user -- that's why we stopped using lockfiles > In our commercial product. It seems it depends on the expectations. I consider it as a feature that by default a linux user cannot access serial ports. Maybe root connected a modem (can produce phone bills) or even some serial card reader, maybe with the web servers key pair. I would expect that by default a user cannot open the serial port because of insufficient permissions on the device file. I would expect this on other unices as well (but I don't know it). For windows I think it should be similar but not impacting so much in practice, because often windows users work with big permissions on a somewhat high priviledge level or even Administrator. > If we are to still respect lockfiles, we first need to > Understand where we are expected to look for them. Does > Anybody have any insight what variants of lockfile folder > Schema exist out there in the wild? Some apps like minicom > Seem to even allow users to manually specify a lockfile > Folder of their choice. At least my (ancient) minicom does not allow the user to change this option, it is displayed but read-only, but root is allowed to change it. > Because of the difficulty finding the right lockfile folder, > And because of the inherent risk of thinking that something > Might be locked while it actually isn't, I'd suggest that > RXTX should have a "soft-off" feature that allows disabling > ALL Lockfile checks at runtime without recompiling the native > Sharedlibs. sounds very reasonable, yes... and as admin I would not wish that users could skip such locking because they do things wrong by default ;) (in the end I guess that is related to the dilemma, that hotplug/user-owned-periphery and multi-user systems simply conflict) > Trent - I like your strategy outline, but I think that it > Needs to be configurable by the client such that users and/or > Customer Support can disable lockfiles / disable ioctl in > Case they detect that they are runing on an OS / Kernal that > Does not support one or the other. Yes, this would be good I guess... Applications could offer configuration options to control that, maybe similarily as minicom. BTW, man minicom tells: *B - Lock file location On most systems This should be /usr/spool/uucp. Linux systems use /var/lock. If this directory does not exist, minicom will not attempt to use lockfiles. The statement `Linux systems use /var/lock' is interesting, does anyone know the source of this convention? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Tue Apr 29 16:11:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Apr 2008 16:11:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? These details are outlined in the Filesystem Hierarchy Standard (FHS). http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLOCKLOCKFILES -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Tue Apr 29 18:58:09 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Wed, 30 Apr 2008 10:28:09 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: <200804301028.09307.scldad@sdc.com.au> I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is the same. Any ideas as to how to handle this? Stephen On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: > * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > > The biggest problem that I have seen with lockfiles on Linux > > At least is, that it seems there is no standard with respect > > To the folder in which they should be created. Also, many > > Distributions seem to set up file system permissions in such > > A way that writing to the lockfile folder is not allowed for > > The normal user -- that's why we stopped using lockfiles > > In our commercial product. > > It seems it depends on the expectations. I consider it as a > feature that by default a linux user cannot access serial ports. > Maybe root connected a modem (can produce phone bills) or even > some serial card reader, maybe with the web servers key pair. > > I would expect that by default a user cannot open the serial port > because of insufficient permissions on the device file. I would > expect this on other unices as well (but I don't know it). > > For windows I think it should be similar but not impacting so > much in practice, because often windows users work with big > permissions on a somewhat high priviledge level or even > Administrator. > > > If we are to still respect lockfiles, we first need to > > Understand where we are expected to look for them. Does > > Anybody have any insight what variants of lockfile folder > > Schema exist out there in the wild? Some apps like minicom > > Seem to even allow users to manually specify a lockfile > > Folder of their choice. > > At least my (ancient) minicom does not allow the user to change > this option, it is displayed but read-only, but root is allowed > to change it. > > > Because of the difficulty finding the right lockfile folder, > > And because of the inherent risk of thinking that something > > Might be locked while it actually isn't, I'd suggest that > > RXTX should have a "soft-off" feature that allows disabling > > ALL Lockfile checks at runtime without recompiling the native > > Sharedlibs. > > sounds very reasonable, yes... > and as admin I would not wish that users could skip such > locking because they do things wrong by default ;) > > (in the end I guess that is related to the dilemma, that > hotplug/user-owned-periphery and multi-user systems simply > conflict) > > > Trent - I like your strategy outline, but I think that it > > Needs to be configurable by the client such that users and/or > > Customer Support can disable lockfiles / disable ioctl in > > Case they detect that they are runing on an OS / Kernal that > > Does not support one or the other. > > Yes, this would be good I guess... Applications could offer > configuration options to control that, maybe similarily as > minicom. > > BTW, man minicom tells: > > *B - Lock file location > On most systems This should be /usr/spool/uucp. > Linux systems use /var/lock. If this directory > does not exist, minicom will not attempt to use > lockfiles. > > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure > and expedient electronic transaction acceptance. Ingenico products leverage > proven technology, established standards and unparalleled ergonomics to > provide optimal reliability, versatility and usability. This comprehensive > range of products is complemented by a global array of services and > partnerships, enabling businesses in a number of vertical sectors to accept > transactions anywhere their business takes them. www.ingenico.com This > message may contain confidential and/or privileged information. If you are > not the addressee or authorized to receive this for the addressee, you must > not use, copy, disclose or take any action based on this message or any > information herein. If you have received this message in error, please > advise the sender immediately by reply e-mail and delete this message. > Thank you for your cooperation. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Wed Apr 30 19:30:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 30 Apr 2008 19:30:51 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804301028.09307.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> <200804301028.09307.scldad@sdc.com.au> Message-ID: Hi Stephen, I suspect ioctl/TIOCEXCL open/O_EXCL would do the job. Mac uses TIOCEXCL and it is POSIX. We use O_EXCL for lockfiles on Linux already. On Wed, 30 Apr 2008, Stephen Davies wrote: > I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is > the same. > > Any ideas as to how to handle this? > > Stephen > > > On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: >> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: >>> The biggest problem that I have seen with lockfiles on Linux >>> At least is, that it seems there is no standard with respect >>> To the folder in which they should be created. Also, many >>> Distributions seem to set up file system permissions in such >>> A way that writing to the lockfile folder is not allowed for >>> The normal user -- that's why we stopped using lockfiles >>> In our commercial product. >> >> It seems it depends on the expectations. I consider it as a >> feature that by default a linux user cannot access serial ports. >> Maybe root connected a modem (can produce phone bills) or even >> some serial card reader, maybe with the web servers key pair. >> >> I would expect that by default a user cannot open the serial port >> because of insufficient permissions on the device file. I would >> expect this on other unices as well (but I don't know it). >> >> For windows I think it should be similar but not impacting so >> much in practice, because often windows users work with big >> permissions on a somewhat high priviledge level or even >> Administrator. >> >>> If we are to still respect lockfiles, we first need to >>> Understand where we are expected to look for them. Does >>> Anybody have any insight what variants of lockfile folder >>> Schema exist out there in the wild? Some apps like minicom >>> Seem to even allow users to manually specify a lockfile >>> Folder of their choice. >> >> At least my (ancient) minicom does not allow the user to change >> this option, it is displayed but read-only, but root is allowed >> to change it. >> >>> Because of the difficulty finding the right lockfile folder, >>> And because of the inherent risk of thinking that something >>> Might be locked while it actually isn't, I'd suggest that >>> RXTX should have a "soft-off" feature that allows disabling >>> ALL Lockfile checks at runtime without recompiling the native >>> Sharedlibs. >> >> sounds very reasonable, yes... >> and as admin I would not wish that users could skip such >> locking because they do things wrong by default ;) >> >> (in the end I guess that is related to the dilemma, that >> hotplug/user-owned-periphery and multi-user systems simply >> conflict) >> >>> Trent - I like your strategy outline, but I think that it >>> Needs to be configurable by the client such that users and/or >>> Customer Support can disable lockfiles / disable ioctl in >>> Case they detect that they are runing on an OS / Kernal that >>> Does not support one or the other. >> >> Yes, this would be good I guess... Applications could offer >> configuration options to control that, maybe similarily as >> minicom. >> >> BTW, man minicom tells: >> >> *B - Lock file location >> On most systems This should be /usr/spool/uucp. >> Linux systems use /var/lock. If this directory >> does not exist, minicom will not attempt to use >> lockfiles. >> >> The statement `Linux systems use /var/lock' is interesting, does >> anyone know the source of this convention? >> >> oki, >> >> Steffen >> >> About Ingenico Throughout the world businesses rely on Ingenico for secure >> and expedient electronic transaction acceptance. Ingenico products leverage >> proven technology, established standards and unparalleled ergonomics to >> provide optimal reliability, versatility and usability. This comprehensive >> range of products is complemented by a global array of services and >> partnerships, enabling businesses in a number of vertical sectors to accept >> transactions anywhere their business takes them. www.ingenico.com This >> message may contain confidential and/or privileged information. If you are >> not the addressee or authorized to receive this for the addressee, you must >> not use, copy, disclose or take any action based on this message or any >> information herein. If you have received this message in error, please >> advise the sender immediately by reply e-mail and delete this message. >> Thank you for your cooperation. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0071.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0069.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0056.html From pboulton at pulsetracer.com Fri Apr 18 14:30:13 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Fri, 18 Apr 2008 13:30:13 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site Message-ID: <480904D5.1060307@pulsetracer.com> Hello, gentle serial porters. I have downloaded the zipped up binaries for use on Windows without Sun's CommAPI, but don't seem able to extract anything from the download. Go to main page, http://www.rxtx.org/ Click on Downloads I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) And I save it to disk. If I try and extract the files with WinZip, Winzip thinks the archive is corrupt. If I try using Windows Explorer, I am able to extract it into a single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than the original .zip. Any help would be much appreciated. Sincerely, Philip Boulton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080418/97d89793/attachment-0054.html From tjarvi at qbang.org Fri Apr 18 19:07:00 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 18 Apr 2008 19:07:00 -0600 (MDT) Subject: [Rxtx] Difficulty opening zip file at rxtx site In-Reply-To: <480904D5.1060307@pulsetracer.com> References: <480904D5.1060307@pulsetracer.com> Message-ID: On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org From pboulton at pulsetracer.com Sat Apr 19 12:46:26 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Sat, 19 Apr 2008 11:46:26 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site References: <480904D5.1060307@pulsetracer.com> Message-ID: <53DB7576450695419E09299104043761A78533@ZTGSERVER.ztg.local> I have been able to get my hands on the binaries, by going to the ftp directory /pub/rxtx at ftp.qbang.org,, and ftping the file rxtx-2.1-7-bins-r2.zip . This opens happily with Winzip, and extracts as the set of files that you describe below. I only experience the ill-formed archive problem by clicking the link on the rxtx.org Downloads page (http://rxtx.qbang.org/pub/rxtx/ rxtx-2.1-7-bins-r2.zip ). Not sure what to make of that. Philip Boulton ________________________________ From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Fri 4/18/2008 6:07 PM To: Philip Boulton Cc: rxtx at qbang.org Subject: Re: [Rxtx] Difficulty opening zip file at rxtx site On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080419/147923bb/attachment-0053.html From jlar310 at gmail.com Sat Apr 19 19:11:55 2008 From: jlar310 at gmail.com (Jeff Larsen) Date: Sat, 19 Apr 2008 20:11:55 -0500 Subject: [Rxtx] Moxa serial over Ethernet driver Message-ID: Hi all, I've been using javax.comm for years to communicate with a legacy radio data system. We want to migrate the java side of the system to a VMware Server virtual machine. We've had great success using Moxa DE-303 and 5610 serial over Ethernet appliances and virtual machines for running hylafax. The OS (Linux in this case) uses a kernel driver to communicate with the Moxa via a virtual serial port such as /dev/ttyr00. I want to do the same thing with javax.comm or gnu.io to connect to a virtual serial port. However I'm hitting road blocks everywhere. javax.comm for Linux sees the virtual port, but there are transmission errors. Tried Solaris too, but the Solaris Moxa drivers don't play nice with javax.comm because the driver uses /dev/pts/n instead of /dev/term/x. Next I tried RXTX on Linux, but I'm getting NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX on Solaris. Has anyone used RXTX with serial over Ethernet devices? Any hints on how to make it work? I know that I'm not completely off track because javax.comm does work with Moxa on a Windows platform, but that's just not an option for production deployment. -- Jeff From tjarvi at qbang.org Sat Apr 19 21:08:41 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 19 Apr 2008 21:08:41 -0600 (MDT) Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: yOn Sat, 19 Apr 2008, Jeff Larsen wrote: > Hi all, > > I've been using javax.comm for years to communicate with a legacy > radio data system. We want to migrate the java side of the system to a > VMware Server virtual machine. We've had great success using Moxa > DE-303 and 5610 serial over Ethernet appliances and virtual machines > for running hylafax. The OS (Linux in this case) uses a kernel driver > to communicate with the Moxa via a virtual serial port such as > /dev/ttyr00. > > I want to do the same thing with javax.comm or gnu.io to connect to a > virtual serial port. However I'm hitting road blocks everywhere. > javax.comm for Linux sees the virtual port, but there are transmission > errors. Tried Solaris too, but the Solaris Moxa drivers don't play > nice with javax.comm because the driver uses /dev/pts/n instead of > /dev/term/x. Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris. > > Has anyone used RXTX with serial over Ethernet devices? Any hints on > how to make it work? > > I know that I'm not completely off track because javax.comm does work > with Moxa on a Windows platform, but that's just not an option for > production deployment. > > Moxa should work under linux. There may be minor issues depending upon how complete the kernel driver is but I think it will work. One of the minor issues is /dev/ttyr00 is not enumerated. There are several work arounds documented with the source code and on the wiki. The easiest solution for testing purposes is to make a symbolic link from /dev/ttyr00 to a port that is enumerated such as /dev/ttyS129. You can later alter the rxtx source or use properties to change the enumerated ports. -- Trent Jarvi tjarvi at qbang.org From d.tonhofer at m-plify.com Sun Apr 20 03:33:30 2008 From: d.tonhofer at m-plify.com (David Tonhofer (M-PLIFY S.A.)) Date: Sun, 20 Apr 2008 11:33:30 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: <480B0DEA.5010908@m-plify.com> Jeff Larsen wrote: > Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris It might be that the Java side of RXTX does not recognize that portname. Trying modifying src/RXTXCommDriver.java as described in this case: http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card From ajmas at sympatico.ca Sun Apr 20 16:37:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Apr 2008 18:37:59 -0400 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <480B0DEA.5010908@m-plify.com> References: <480B0DEA.5010908@m-plify.com> Message-ID: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > Jeff Larsen wrote: >> Next I tried RXTX on Linux, but I'm getting >> NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX >> on Solaris > It might be that the Java side of RXTX does not recognize that > portname. > Trying modifying src/RXTXCommDriver.java as described in this case: > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card I wonder whether it would be worth allowing custom port prefixes as a system parameter? For example: gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" Andre From Martin.Oberhuber at windriver.com Tue Apr 22 12:34:36 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 22 Apr 2008 20:34:36 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> References: <480B0DEA.5010908@m-plify.com> <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE6485848056CD6CE@ism-mail03.corp.ad.wrs.com> Sounds like a great idea... I'm wondering how the "variable part" after the Prefixes could be specified though? What about allowing Regular Expression character Classes in the existing System Property for specifying ports: System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyS[0-9],ttyS[ABC],ttyUSB[0-9a-z]"); The set of allowed patterns would of course need to Be restricted compared to REGEX, because it must be A syntax that supports iterating over it. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Montag, 21. April 2008 00:38 > To: rxtx at qbang.org and Users > Subject: Re: [Rxtx] Moxa serial over Ethernet driver > > > On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > > Jeff Larsen wrote: > >> Next I tried RXTX on Linux, but I'm getting > >> NoSuchPortException connecting to /dev/ttyr00. I have yet > to try RXTX > >> on Solaris > > It might be that the Java side of RXTX does not recognize that > > portname. > > Trying modifying src/RXTXCommDriver.java as described in this case: > > > > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_ > SST-4P.2FLP_multiport_card > > I wonder whether it would be worth allowing custom port > prefixes as a > system parameter? For > example: > > gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Loi.TRAN at weatherford.com Tue Apr 22 13:10:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Tue, 22 Apr 2008 14:10:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled Message-ID: Hi, I'm currently using the Java RXTX API to interface to a serial port. The serial port is connected to a bridge board that communicates with our communications system running at 1.875 Mbps which is linked to an embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no flow control). I send a command to the embedded board through the serial-bridge board which then is relayed to the embedded board. The command sent asks the embedded board to dump a binary image. Here's where I'm hitting some problems. I've successfully done this is an integrated serial port from the laptop. The binary file that comes back is consistent on every attempt. When I use the application I've written to do the same thing with a USB-to-serial adapter, the image I get back is not the same as the image I receive through the USB-to-serial adapter is not consistent at all. A final thing is that when I use a terminal program to dump the binary image with the USB-serial adapter, the image is correct. Every time! What is the terminal program doing that's not being done in my application? My application is quite simple. Has anyone observed this behavior before? If you have, I'd like to know how you've gotten around this problem. Thanks, LT =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From tjarvi at qbang.org Tue Apr 22 21:11:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 22 Apr 2008 21:11:10 -0600 (MDT) Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org From Loi.TRAN at weatherford.com Wed Apr 23 08:35:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Wed, 23 Apr 2008 09:35:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: Thanks for all the responses. I finally tried something that worked consistently. I updated my Prolific driver and repeated my tests. It worked. If you're using the Prolific type USB-serial adapters, do no use the Prolific version 2.0.2.1 driver on Windows. Update it to the latest 2.0.2.8 version. Again, thanks for all the responses. LT -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Tuesday, April 22, 2008 10:11 PM To: TRAN, Loi X. Cc: rxtx at qbang.org Subject: Re: [Rxtx] Prolific USB - RXTX data mangled On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From Martin.Oberhuber at windriver.com Wed Apr 23 18:54:26 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 02:54:26 +0200 Subject: [Rxtx] RXTX port locking on Linux status? Message-ID: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Dear RXTX community, I'm wondering what the status is with RXTX locking serial ports on Linux? My understanding is that the mechanism used in 2.1-7r2 (lockfiles) is not really state of the art, and has lots of problems (e.g. missing permissions). There was an idea to migrate towards a Kernel syscall based solution for port locking. What's the status here? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/9878db9f/attachment-0049.html From tjarvi at qbang.org Wed Apr 23 20:32:24 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Apr 2008 20:32:24 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > Dear RXTX community, > > I'm wondering what the status is with RXTX locking > serial ports on Linux? > > My understanding is that the mechanism used in > 2.1-7r2 (lockfiles) is not really state of the art, and > has lots of problems (e.g. missing permissions). > > There was an idea to migrate towards a Kernel > syscall based solution for port locking. > > What's the status here? > Hi Martin, I'm in favor of deprecating the current FHS locking mechanism in favor of an IOCTL when available. I think it will be available on all the platforms but do not know for sure. The status is unchanged. I've had very few free cycles for such things. Feel free to take a stab at it if you have some time. I believe the IOCTL is used in the Mac OS X code already. I don't see any real backwards compatability issues and the IOCTL should just work. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Apr 24 06:14:06 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 14:14:06 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Thanks Trent. Problem is only that I'm really not at all Familiar with the C part of RXTX. If there Were anything I could do in Java for this, It would be easier for me.... ... Are there any C experts here on the list Who'd like to look at ioctl port locking For linux? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Donnerstag, 24. April 2008 04:32 > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > I'm wondering what the status is with RXTX locking > > serial ports on Linux? > > > > My understanding is that the mechanism used in > > 2.1-7r2 (lockfiles) is not really state of the art, and > > has lots of problems (e.g. missing permissions). > > > > There was an idea to migrate towards a Kernel > > syscall based solution for port locking. > > > > What's the status here? > > > > Hi Martin, > > I'm in favor of deprecating the current FHS locking mechanism > in favor of > an IOCTL when available. I think it will be available on all the > platforms but do not know for sure. > > The status is unchanged. I've had very few free cycles for > such things. > Feel free to take a stab at it if you have some time. I > believe the IOCTL > is used in the Mac OS X code already. > > I don't see any real backwards compatability issues and the > IOCTL should > just work. > > -- > Trent Jarvi > tjarvi at qbang.org > From sspies at sloc.de Thu Apr 24 07:15:36 2008 From: sspies at sloc.de (Sebastian Spies) Date: Thu, 24 Apr 2008 15:15:36 +0200 (CEST) Subject: [Rxtx] rxtx on gumstix: Interrupted system call In-Reply-To: <47FB7B20.7080504@sloc.de> References: <47FB7B20.7080504@sloc.de> Message-ID: <55445.130.83.139.205.1209042936.squirrel@ssl.sloc.de> Dear list, while porting rxtx to the gumstix, I found out, that select used in readArray in SerialImp.c might not work as expected. Maybe, because of missing TIOCSERGETLSR-support? select is often interrupted, so i wrote the following quick'n'dirty hack to make it work on gumstix: diff -Nur rxtx-2.1-7r2/src/SerialImp.c rxtx-2.1-7r2/src/SerialImp.c --- rxtx-2.1-7r2/src/SerialImp.c 2006-01-29 23:19:04.000000000 +0100 +++ rxtx-2.1-7r2-patched/src/SerialImp.c 2008-04-24 14:30:17.000000000 +0200 @@ -3380,7 +3381,7 @@ JNIEXPORT jint JNICALL RXTXPort(readArray)( JNIEnv *env, jobject jobj, jbyteArray jbarray, jint offset, jint length ) { - int bytes; + int bytes = 0; jbyte *body; /* char msg[80]; */ int fd = get_java_var( env, jobj, "fd", "I" ); @@ -3397,9 +3398,18 @@ "readArray", "Invalid length" ); return -1; } - body = (*env)->GetByteArrayElements( env, jbarray, 0 ); - bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ - (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + while(1 > bytes) + { + body = (*env)->GetByteArrayElements( env, jbarray, 0 ); + bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ + (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + // quick'n'dirty - SSP + report (" trying again... \n"); + errno = 0; + } + if( bytes < 0 ) { report( "RXTXPort:readArray bytes < 0" ); LEAVE( "RXTXPort:readArray" ); > Hey, > > I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use > RXTXPort$SerialInputStream.read(), then I get the following Exception. I > did not yet figure out which system call is interrupted as strace > produces loads of output. > > Any help would be very appreciated. Thanks in advance. > Sebastian > > > [java] java.io.IOException: Interrupted system call in readArray > [java] at gnu.io.RXTXPort.readArray(Native Method) > [java] at > gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) > [java] at > java.io.FilterInputStream.read(FilterInputStream.java:189) > [java] at > java.io.BufferedInputStream.refill(BufferedInputStream.java:371) > [java] at > java.io.BufferedInputStream.read(BufferedInputStream.java:229) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) > [java] at > com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) > > -- > Sebastian Spies > > mail: sspies at sloc.de > > > > From fire_baptized at hotmail.com Thu Apr 24 18:27:48 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Thu, 24 Apr 2008 20:27:48 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hello I am having a problem with the serial device connecting (software wise) to the serial port. However I have a test program and it seems to work just fine in that environment - and it doesnt use GUI. The error I am getting is : PortNotFoundException Now the way I have it setup in the GUI environment is that once the user pushes a JButton the program connects using this class: protected void establishConnection() { try { portId = CommPortIdentifier.getPortIdentifier("COM3"); System.out.println("Establishing connction....."); messages[0] = "\nEstablishing connction.....\n"; } catch ( NoSuchPortException noport) { System.out.println("Port not found: "+ noport); messages[0] = "Port not found: "+ noport+"\n"; } try { serialPort = (SerialPort) portId.open("serial", 50); System.out.println("Port has been found."); messages[1] = "Port has been found.\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[1] = "" +usedport; } try { serialPort = (SerialPort) portId.open("serial", 50); messages[2] = "Connecting to COM3 on port 50....\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; } try { serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); System.out.println("Esablishing the transfer rate settings for COM3."); messages[3] = "Esablishing the transfer rate settings for COM3.\n"; } catch (UnsupportedCommOperationException nosupcom) { System.out.println(nosupcom); System.out.println("The tranfer rate could not be esblished on COM3."); messages[3] = "The tranfer rate could not be esblished on COM3.\n"; } System.out.println(serialPort.getFlowControlMode()); messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; //sendDataOut(buffer[3],buffer[4]); } I need all the data in this method (and all the string values in this method) to be printed out on a JTextArea. I wont do me any good if not all the text is printed on a JTextArea in another class. So I have the text printing the JTextArea correctly, but everytime the JButton is activated - it gives me that error message. I did add a disconnect button that is supposed to call the serialPort.close(). _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/273fd4ec/attachment-0048.html From tjarvi at qbang.org Thu Apr 24 21:54:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Apr 2008 21:54:10 -0600 (MDT) Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > Hello I am having a problem with the serial device connecting (software > wise) to the serial port. However I have a test program and it seems to > work just fine in that environment - and it doesnt use GUI. The error I > am getting is : PortNotFoundException Now the way I have it setup in the > GUI environment is that once the user pushes a JButton the program > connects using this class: > > protected void establishConnection() { > try { > portId = CommPortIdentifier.getPortIdentifier("COM3"); > System.out.println("Establishing connction....."); > messages[0] = "\nEstablishing connction.....\n"; > } > catch ( NoSuchPortException noport) { > System.out.println("Port not found: "+ noport); > messages[0] = "Port not found: "+ noport+"\n"; > } > try { > serialPort = (SerialPort) portId.open("serial", 50); > System.out.println("Port has been found."); > messages[1] = "Port has been found.\n"; > } > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[1] = "" +usedport; > } ================================================================= > try { > serialPort = (SerialPort) portId.open("serial", 50); > messages[2] = "Connecting to COM3 on port 50....\n"; > } ================================================================== > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > } > try { > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > System.out.println("Esablishing the transfer rate settings for COM3."); > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > } > catch (UnsupportedCommOperationException nosupcom) { > System.out.println(nosupcom); > System.out.println("The tranfer rate could not be esblished on COM3."); > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > } > System.out.println(serialPort.getFlowControlMode()); > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > //sendDataOut(buffer[3],buffer[4]); > } > > I need all the data in this method (and all the string values in this > method) to be printed out on a JTextArea. I wont do me any good if not > all the text is printed on a JTextArea in another class. So I have the > text printing the JTextArea correctly, but everytime the JButton is > activated - it gives me that error message. I did add a disconnect > button that is supposed to call the serialPort.close(). > The open code used twice is going to throw an exception. It may be that you catch the exception above this code and print a confusing message? A common mistake is people will accidently run two copies of their program. The first instance of the program will open the port and prevent enumeration (finding the port) in the second instance of the program. As an example, you may be running your text based application which is preventing the GUI from seeing the port. Enumeration is done by trying to open the port. If the port is open, Enumeration fails. -- Trent Jarvi tjarvi at qbang.org From fire_baptized at hotmail.com Thu Apr 24 22:32:05 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 00:32:05 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Wow - thanks dude what a dumb thing for me to not catch..... now here is the current problem - right now I am trying to output data again one is with the test program - and it seems that serialPort.setRTS(true); is throwing an exceptions there - now if I show this code please bare in mind that I am only testing - the code is kinda sloppy in my mind - but if I can figure out why calling this function is throwing an exception then maybe I can figure out why my GUI application is getting the same null pointer exceptions when try to send out the data stream. FYI Trent this email is not directed towards you - anyone can jump in on this public static void main(String args[]) { byte[] b = new byte[64]; int keyinput = 0 ; byte x = 0; byte y = 0; PortTesting1 testports = new PortTesting1(); try { joyskoro = Joystick.createInstance(); } catch (IOException ioexc) { System.out.println("There is an input/output problem: " + ioexc); } while (true) { joyskoro.poll(); b[0] = ((byte) -(10 * joyskoro.getY())); b[1] = ((byte) (10 * joyskoro.getX())); System.out.println("The 3rd byte is: " +b[0]); System.out.println("The 4rd byte is: " +b[1]); serialPort.setRTS(true); // HERE IS WHERE THE PROBLEM IS !!!!!!! ON THIS LINE but if I dont have it active in my program the Bluetooth device (that is System.out.println("Ready to send :-) !"); //connected to the serial port does not send out data!!!!! if (joyskoro.isButtonDown(joyskoro.BUTTON10)) { System.out.println("Connection terminated."); serialPort.close(); break; } if (joyskoro.isButtonDown(joyskoro.BUTTON2)) { boolean flag = true; //reading from key input from the keyboard System.out.println("Please input a command: "); while (flag) { try { keyinput = System.in.read(); } catch (IOException ioexc) {/*there is no need to put * anything here */ } if((char)keyinput=='w') { pushIt((byte)85); } if((char)keyinput=='s') { pushIt((byte)84); } if((char)keyinput=='a') { pushIt((byte)83); } if((char)keyinput=='d') { pushIt((byte)82); } if((char)keyinput=='q') { pushIt((byte)89); } if((char)keyinput=='\t') { //this stop reading input from the keyboard flag = false; } } and help anyways here is the block of code that throwing an exception for the test program: > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/5c8f7d68/attachment-0048.html From fire_baptized at hotmail.com Fri Apr 25 07:59:53 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 09:59:53 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Are there any examples of how to push out data? As in using input and output streams - if I can compare code maybe I can see where this is causing a problem. I have a byte array that I am pushing out data. I keep getting null pointer exceptions every where I turn. > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/22228ab6/attachment-0047.html From ajmas at sympatico.ca Sat Apr 26 07:37:09 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 26 Apr 2008 09:37:09 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hi, On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote: > > Are there any examples of how to push out data? As in using input > and output streams - if I can compare code maybe I can see where > this is causing a problem. I have a byte array that I am pushing > out data. I keep getting null pointer exceptions every where I turn. > There are some examples here that might be of help: http://rxtx.qbang.org/wiki/index.php/Examples Andre From fire_baptized at hotmail.com Sat Apr 26 20:13:54 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Sat, 26 Apr 2008 22:13:54 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: looked at those....yep didnt help - I need to push out data with GUI and not get a null pointer exception everytime I try. > CC: rxtx at qbang.org> From: ajmas at sympatico.ca> To: fire_baptized at hotmail.com> Subject: Re: [Rxtx] Serial Problems with Gui.....> Date: Sat, 26 Apr 2008 09:37:09 -0400> > Hi,> > > On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote:> >> > Are there any examples of how to push out data? As in using input > > and output streams - if I can compare code maybe I can see where > > this is causing a problem. I have a byte array that I am pushing > > out data. I keep getting null pointer exceptions every where I turn.> >> > There are some examples here that might be of help:> > http://rxtx.qbang.org/wiki/index.php/Examples> > Andre _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080426/09f95b41/attachment-0046.html From michael.erskine at ketech.com Mon Apr 28 02:47:22 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 28 Apr 2008 09:47:22 +0100 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D426EF3CBBC5@no-sv-03.ketech.local> Jesrael D. Summerhill wrote: > looked at those....yep didnt help - I need to push out data with GUI and > not get a null pointer exception everytime I try. So it seems pretty obvious that your code needs to check for nulls wherever one may occur and report what's happening. Alternatively, catch the npe and display the stack trace. Then you can fix your code so it doesn't try to work with something that ain't there. Regards, Michael Erskine. From scldad at sdc.com.au Mon Apr 28 03:58:34 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Mon, 28 Apr 2008 19:28:34 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Message-ID: <200804281928.34454.scldad@sdc.com.au> Has anybody done any design work on this? The first thing that springs to mind is that we still need to check for lock files because other apps tend to use that approach even if we go to ioctl. Cheers, Stephen Davies On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > Thanks Trent. > > Problem is only that I'm really not at all > Familiar with the C part of RXTX. If there > Were anything I could do in Java for this, > It would be easier for me.... > > ... Are there any C experts here on the list > Who'd like to look at ioctl port locking > For linux? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > -----Original Message----- > > From: Trent Jarvi [mailto:tjarvi at qbang.org] > > Sent: Donnerstag, 24. April 2008 04:32 > > To: Oberhuber, Martin > > Cc: rxtx at qbang.org > > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > > > I'm wondering what the status is with RXTX locking > > > serial ports on Linux? > > > > > > My understanding is that the mechanism used in > > > 2.1-7r2 (lockfiles) is not really state of the art, and > > > has lots of problems (e.g. missing permissions). > > > > > > There was an idea to migrate towards a Kernel > > > syscall based solution for port locking. > > > > > > What's the status here? > > > > Hi Martin, > > > > I'm in favor of deprecating the current FHS locking mechanism > > in favor of > > an IOCTL when available. I think it will be available on all the > > platforms but do not know for sure. > > > > The status is unchanged. I've had very few free cycles for > > such things. > > Feel free to take a stab at it if you have some time. I > > believe the IOCTL > > is used in the Mac OS X code already. > > > > I don't see any real backwards compatability issues and the > > IOCTL should > > just work. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Mon Apr 28 04:21:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 28 Apr 2008 04:21:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804281928.34454.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: I don't think there would need to be any architectural changes. A couple ifdefs and minor changes in the current code should be enough. Proposal: FHS/UUCP locks: continue to respect them, try to create them but do not error if the IOCTL is supported. (But does the IOCTL being defined mean it will work?) Enumeration: Do not assert the IOCTL while opening. Serial.open: assert the IOCTL after open. Continue to use locks as described above after asserting the IOCTL. If the IOCTL is defined but not working, handle it here. Failure cases include the IOCTL is not supported and the port is already locked. On Mon, 28 Apr 2008, Stephen Davies wrote: > Has anybody done any design work on this? > The first thing that springs to mind is that we still need to check for lock > files because other apps tend to use that approach even if we go to ioctl. > > Cheers, > Stephen Davies > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: >> Thanks Trent. >> >> Problem is only that I'm really not at all >> Familiar with the C part of RXTX. If there >> Were anything I could do in Java for this, >> It would be easier for me.... >> >> ... Are there any C experts here on the list >> Who'd like to look at ioctl port locking >> For linux? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >>> -----Original Message----- >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] >>> Sent: Donnerstag, 24. April 2008 04:32 >>> To: Oberhuber, Martin >>> Cc: rxtx at qbang.org >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? >>> >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: >>>> Dear RXTX community, >>>> >>>> I'm wondering what the status is with RXTX locking >>>> serial ports on Linux? >>>> >>>> My understanding is that the mechanism used in >>>> 2.1-7r2 (lockfiles) is not really state of the art, and >>>> has lots of problems (e.g. missing permissions). >>>> >>>> There was an idea to migrate towards a Kernel >>>> syscall based solution for port locking. >>>> >>>> What's the status here? >>> >>> Hi Martin, >>> >>> I'm in favor of deprecating the current FHS locking mechanism >>> in favor of >>> an IOCTL when available. I think it will be available on all the >>> platforms but do not know for sure. >>> >>> The status is unchanged. I've had very few free cycles for >>> such things. >>> Feel free to take a stab at it if you have some time. I >>> believe the IOCTL >>> is used in the Mac OS X code already. >>> >>> I don't see any real backwards compatability issues and the >>> IOCTL should >>> just work. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Tue Apr 29 12:04:04 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Apr 2008 20:04:04 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Hi all, The biggest problem that I have seen with lockfiles on Linux At least is, that it seems there is no standard with respect To the folder in which they should be created. Also, many Distributions seem to set up file system permissions in such A way that writing to the lockfile folder is not allowed for The normal user -- that's why we stopped using lockfiles In our commercial product. If we are to still respect lockfiles, we first need to Understand where we are expected to look for them. Does Anybody have any insight what variants of lockfile folder Schema exist out there in the wild? Some apps like minicom Seem to even allow users to manually specify a lockfile Folder of their choice. Because of the difficulty finding the right lockfile folder, And because of the inherent risk of thinking that something Might be locked while it actually isn't, I'd suggest that RXTX should have a "soft-off" feature that allows disabling ALL Lockfile checks at runtime without recompiling the native Sharedlibs. Trent - I like your strategy outline, but I think that it Needs to be configurable by the client such that users and/or Customer Support can disable lockfiles / disable ioctl in Case they detect that they are runing on an OS / Kernal that Does not support one or the other. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Montag, 28. April 2008 12:22 > To: Stephen Davies > Cc: rxtx at qbang.org; Oberhuber, Martin; Trent Jarvi > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > I don't think there would need to be any architectural > changes. A couple > ifdefs and minor changes in the current code should be enough. > > Proposal: > > FHS/UUCP locks: > continue to respect them, try to create them but do not error if > the IOCTL is supported. (But does the IOCTL being defined mean > it will work?) > Enumeration: > Do not assert the IOCTL while opening. > Serial.open: > assert the IOCTL after open. Continue to use locks as described > above after asserting the IOCTL. If the IOCTL is defined but > not working, handle it here. Failure cases include the IOCTL > is not supported and the port is already locked. > > On Mon, 28 Apr 2008, Stephen Davies wrote: > > > Has anybody done any design work on this? > > The first thing that springs to mind is that we still need > to check for lock > > files because other apps tend to use that approach even if > we go to ioctl. > > > > Cheers, > > Stephen Davies > > > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > >> Thanks Trent. > >> > >> Problem is only that I'm really not at all > >> Familiar with the C part of RXTX. If there > >> Were anything I could do in Java for this, > >> It would be easier for me.... > >> > >> ... Are there any C experts here on the list > >> Who'd like to look at ioctl port locking > >> For linux? > >> > >> Thanks, > >> -- > >> Martin Oberhuber, Senior Member of Technical Staff, Wind River > >> Target Management Project Lead, DSDP PMC Member > >> http://www.eclipse.org/dsdp/tm > >> > >>> -----Original Message----- > >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] > >>> Sent: Donnerstag, 24. April 2008 04:32 > >>> To: Oberhuber, Martin > >>> Cc: rxtx at qbang.org > >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? > >>> > >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > >>>> Dear RXTX community, > >>>> > >>>> I'm wondering what the status is with RXTX locking > >>>> serial ports on Linux? > >>>> > >>>> My understanding is that the mechanism used in > >>>> 2.1-7r2 (lockfiles) is not really state of the art, and > >>>> has lots of problems (e.g. missing permissions). > >>>> > >>>> There was an idea to migrate towards a Kernel > >>>> syscall based solution for port locking. > >>>> > >>>> What's the status here? > >>> > >>> Hi Martin, > >>> > >>> I'm in favor of deprecating the current FHS locking mechanism > >>> in favor of > >>> an IOCTL when available. I think it will be available on all the > >>> platforms but do not know for sure. > >>> > >>> The status is unchanged. I've had very few free cycles for > >>> such things. > >>> Feel free to take a stab at it if you have some time. I > >>> believe the IOCTL > >>> is used in the Mac OS X code already. > >>> > >>> I don't see any real backwards compatability issues and the > >>> IOCTL should > >>> just work. > >>> > >>> -- > >>> Trent Jarvi > >>> tjarvi at qbang.org > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > From Steffen.DETTMER at ingenico.com Tue Apr 29 13:34:44 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 29 Apr 2008 21:34:44 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Message-ID: <20080429193444.GU2928@elberon.bln.de.ingenico.com> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > The biggest problem that I have seen with lockfiles on Linux > At least is, that it seems there is no standard with respect > To the folder in which they should be created. Also, many > Distributions seem to set up file system permissions in such > A way that writing to the lockfile folder is not allowed for > The normal user -- that's why we stopped using lockfiles > In our commercial product. It seems it depends on the expectations. I consider it as a feature that by default a linux user cannot access serial ports. Maybe root connected a modem (can produce phone bills) or even some serial card reader, maybe with the web servers key pair. I would expect that by default a user cannot open the serial port because of insufficient permissions on the device file. I would expect this on other unices as well (but I don't know it). For windows I think it should be similar but not impacting so much in practice, because often windows users work with big permissions on a somewhat high priviledge level or even Administrator. > If we are to still respect lockfiles, we first need to > Understand where we are expected to look for them. Does > Anybody have any insight what variants of lockfile folder > Schema exist out there in the wild? Some apps like minicom > Seem to even allow users to manually specify a lockfile > Folder of their choice. At least my (ancient) minicom does not allow the user to change this option, it is displayed but read-only, but root is allowed to change it. > Because of the difficulty finding the right lockfile folder, > And because of the inherent risk of thinking that something > Might be locked while it actually isn't, I'd suggest that > RXTX should have a "soft-off" feature that allows disabling > ALL Lockfile checks at runtime without recompiling the native > Sharedlibs. sounds very reasonable, yes... and as admin I would not wish that users could skip such locking because they do things wrong by default ;) (in the end I guess that is related to the dilemma, that hotplug/user-owned-periphery and multi-user systems simply conflict) > Trent - I like your strategy outline, but I think that it > Needs to be configurable by the client such that users and/or > Customer Support can disable lockfiles / disable ioctl in > Case they detect that they are runing on an OS / Kernal that > Does not support one or the other. Yes, this would be good I guess... Applications could offer configuration options to control that, maybe similarily as minicom. BTW, man minicom tells: *B - Lock file location On most systems This should be /usr/spool/uucp. Linux systems use /var/lock. If this directory does not exist, minicom will not attempt to use lockfiles. The statement `Linux systems use /var/lock' is interesting, does anyone know the source of this convention? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Tue Apr 29 16:11:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Apr 2008 16:11:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? These details are outlined in the Filesystem Hierarchy Standard (FHS). http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLOCKLOCKFILES -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Tue Apr 29 18:58:09 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Wed, 30 Apr 2008 10:28:09 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: <200804301028.09307.scldad@sdc.com.au> I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is the same. Any ideas as to how to handle this? Stephen On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: > * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > > The biggest problem that I have seen with lockfiles on Linux > > At least is, that it seems there is no standard with respect > > To the folder in which they should be created. Also, many > > Distributions seem to set up file system permissions in such > > A way that writing to the lockfile folder is not allowed for > > The normal user -- that's why we stopped using lockfiles > > In our commercial product. > > It seems it depends on the expectations. I consider it as a > feature that by default a linux user cannot access serial ports. > Maybe root connected a modem (can produce phone bills) or even > some serial card reader, maybe with the web servers key pair. > > I would expect that by default a user cannot open the serial port > because of insufficient permissions on the device file. I would > expect this on other unices as well (but I don't know it). > > For windows I think it should be similar but not impacting so > much in practice, because often windows users work with big > permissions on a somewhat high priviledge level or even > Administrator. > > > If we are to still respect lockfiles, we first need to > > Understand where we are expected to look for them. Does > > Anybody have any insight what variants of lockfile folder > > Schema exist out there in the wild? Some apps like minicom > > Seem to even allow users to manually specify a lockfile > > Folder of their choice. > > At least my (ancient) minicom does not allow the user to change > this option, it is displayed but read-only, but root is allowed > to change it. > > > Because of the difficulty finding the right lockfile folder, > > And because of the inherent risk of thinking that something > > Might be locked while it actually isn't, I'd suggest that > > RXTX should have a "soft-off" feature that allows disabling > > ALL Lockfile checks at runtime without recompiling the native > > Sharedlibs. > > sounds very reasonable, yes... > and as admin I would not wish that users could skip such > locking because they do things wrong by default ;) > > (in the end I guess that is related to the dilemma, that > hotplug/user-owned-periphery and multi-user systems simply > conflict) > > > Trent - I like your strategy outline, but I think that it > > Needs to be configurable by the client such that users and/or > > Customer Support can disable lockfiles / disable ioctl in > > Case they detect that they are runing on an OS / Kernal that > > Does not support one or the other. > > Yes, this would be good I guess... Applications could offer > configuration options to control that, maybe similarily as > minicom. > > BTW, man minicom tells: > > *B - Lock file location > On most systems This should be /usr/spool/uucp. > Linux systems use /var/lock. If this directory > does not exist, minicom will not attempt to use > lockfiles. > > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure > and expedient electronic transaction acceptance. Ingenico products leverage > proven technology, established standards and unparalleled ergonomics to > provide optimal reliability, versatility and usability. This comprehensive > range of products is complemented by a global array of services and > partnerships, enabling businesses in a number of vertical sectors to accept > transactions anywhere their business takes them. www.ingenico.com This > message may contain confidential and/or privileged information. If you are > not the addressee or authorized to receive this for the addressee, you must > not use, copy, disclose or take any action based on this message or any > information herein. If you have received this message in error, please > advise the sender immediately by reply e-mail and delete this message. > Thank you for your cooperation. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Wed Apr 30 19:30:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 30 Apr 2008 19:30:51 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804301028.09307.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> <200804301028.09307.scldad@sdc.com.au> Message-ID: Hi Stephen, I suspect ioctl/TIOCEXCL open/O_EXCL would do the job. Mac uses TIOCEXCL and it is POSIX. We use O_EXCL for lockfiles on Linux already. On Wed, 30 Apr 2008, Stephen Davies wrote: > I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is > the same. > > Any ideas as to how to handle this? > > Stephen > > > On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: >> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: >>> The biggest problem that I have seen with lockfiles on Linux >>> At least is, that it seems there is no standard with respect >>> To the folder in which they should be created. Also, many >>> Distributions seem to set up file system permissions in such >>> A way that writing to the lockfile folder is not allowed for >>> The normal user -- that's why we stopped using lockfiles >>> In our commercial product. >> >> It seems it depends on the expectations. I consider it as a >> feature that by default a linux user cannot access serial ports. >> Maybe root connected a modem (can produce phone bills) or even >> some serial card reader, maybe with the web servers key pair. >> >> I would expect that by default a user cannot open the serial port >> because of insufficient permissions on the device file. I would >> expect this on other unices as well (but I don't know it). >> >> For windows I think it should be similar but not impacting so >> much in practice, because often windows users work with big >> permissions on a somewhat high priviledge level or even >> Administrator. >> >>> If we are to still respect lockfiles, we first need to >>> Understand where we are expected to look for them. Does >>> Anybody have any insight what variants of lockfile folder >>> Schema exist out there in the wild? Some apps like minicom >>> Seem to even allow users to manually specify a lockfile >>> Folder of their choice. >> >> At least my (ancient) minicom does not allow the user to change >> this option, it is displayed but read-only, but root is allowed >> to change it. >> >>> Because of the difficulty finding the right lockfile folder, >>> And because of the inherent risk of thinking that something >>> Might be locked while it actually isn't, I'd suggest that >>> RXTX should have a "soft-off" feature that allows disabling >>> ALL Lockfile checks at runtime without recompiling the native >>> Sharedlibs. >> >> sounds very reasonable, yes... >> and as admin I would not wish that users could skip such >> locking because they do things wrong by default ;) >> >> (in the end I guess that is related to the dilemma, that >> hotplug/user-owned-periphery and multi-user systems simply >> conflict) >> >>> Trent - I like your strategy outline, but I think that it >>> Needs to be configurable by the client such that users and/or >>> Customer Support can disable lockfiles / disable ioctl in >>> Case they detect that they are runing on an OS / Kernal that >>> Does not support one or the other. >> >> Yes, this would be good I guess... Applications could offer >> configuration options to control that, maybe similarily as >> minicom. >> >> BTW, man minicom tells: >> >> *B - Lock file location >> On most systems This should be /usr/spool/uucp. >> Linux systems use /var/lock. If this directory >> does not exist, minicom will not attempt to use >> lockfiles. >> >> The statement `Linux systems use /var/lock' is interesting, does >> anyone know the source of this convention? >> >> oki, >> >> Steffen >> >> About Ingenico Throughout the world businesses rely on Ingenico for secure >> and expedient electronic transaction acceptance. Ingenico products leverage >> proven technology, established standards and unparalleled ergonomics to >> provide optimal reliability, versatility and usability. This comprehensive >> range of products is complemented by a global array of services and >> partnerships, enabling businesses in a number of vertical sectors to accept >> transactions anywhere their business takes them. www.ingenico.com This >> message may contain confidential and/or privileged information. If you are >> not the addressee or authorized to receive this for the addressee, you must >> not use, copy, disclose or take any action based on this message or any >> information herein. If you have received this message in error, please >> advise the sender immediately by reply e-mail and delete this message. >> Thank you for your cooperation. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0072.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0070.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0057.html From pboulton at pulsetracer.com Fri Apr 18 14:30:13 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Fri, 18 Apr 2008 13:30:13 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site Message-ID: <480904D5.1060307@pulsetracer.com> Hello, gentle serial porters. I have downloaded the zipped up binaries for use on Windows without Sun's CommAPI, but don't seem able to extract anything from the download. Go to main page, http://www.rxtx.org/ Click on Downloads I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) And I save it to disk. If I try and extract the files with WinZip, Winzip thinks the archive is corrupt. If I try using Windows Explorer, I am able to extract it into a single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than the original .zip. Any help would be much appreciated. Sincerely, Philip Boulton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080418/97d89793/attachment-0055.html From tjarvi at qbang.org Fri Apr 18 19:07:00 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 18 Apr 2008 19:07:00 -0600 (MDT) Subject: [Rxtx] Difficulty opening zip file at rxtx site In-Reply-To: <480904D5.1060307@pulsetracer.com> References: <480904D5.1060307@pulsetracer.com> Message-ID: On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org From pboulton at pulsetracer.com Sat Apr 19 12:46:26 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Sat, 19 Apr 2008 11:46:26 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site References: <480904D5.1060307@pulsetracer.com> Message-ID: <53DB7576450695419E09299104043761A78533@ZTGSERVER.ztg.local> I have been able to get my hands on the binaries, by going to the ftp directory /pub/rxtx at ftp.qbang.org,, and ftping the file rxtx-2.1-7-bins-r2.zip . This opens happily with Winzip, and extracts as the set of files that you describe below. I only experience the ill-formed archive problem by clicking the link on the rxtx.org Downloads page (http://rxtx.qbang.org/pub/rxtx/ rxtx-2.1-7-bins-r2.zip ). Not sure what to make of that. Philip Boulton ________________________________ From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Fri 4/18/2008 6:07 PM To: Philip Boulton Cc: rxtx at qbang.org Subject: Re: [Rxtx] Difficulty opening zip file at rxtx site On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080419/147923bb/attachment-0054.html From jlar310 at gmail.com Sat Apr 19 19:11:55 2008 From: jlar310 at gmail.com (Jeff Larsen) Date: Sat, 19 Apr 2008 20:11:55 -0500 Subject: [Rxtx] Moxa serial over Ethernet driver Message-ID: Hi all, I've been using javax.comm for years to communicate with a legacy radio data system. We want to migrate the java side of the system to a VMware Server virtual machine. We've had great success using Moxa DE-303 and 5610 serial over Ethernet appliances and virtual machines for running hylafax. The OS (Linux in this case) uses a kernel driver to communicate with the Moxa via a virtual serial port such as /dev/ttyr00. I want to do the same thing with javax.comm or gnu.io to connect to a virtual serial port. However I'm hitting road blocks everywhere. javax.comm for Linux sees the virtual port, but there are transmission errors. Tried Solaris too, but the Solaris Moxa drivers don't play nice with javax.comm because the driver uses /dev/pts/n instead of /dev/term/x. Next I tried RXTX on Linux, but I'm getting NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX on Solaris. Has anyone used RXTX with serial over Ethernet devices? Any hints on how to make it work? I know that I'm not completely off track because javax.comm does work with Moxa on a Windows platform, but that's just not an option for production deployment. -- Jeff From tjarvi at qbang.org Sat Apr 19 21:08:41 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 19 Apr 2008 21:08:41 -0600 (MDT) Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: yOn Sat, 19 Apr 2008, Jeff Larsen wrote: > Hi all, > > I've been using javax.comm for years to communicate with a legacy > radio data system. We want to migrate the java side of the system to a > VMware Server virtual machine. We've had great success using Moxa > DE-303 and 5610 serial over Ethernet appliances and virtual machines > for running hylafax. The OS (Linux in this case) uses a kernel driver > to communicate with the Moxa via a virtual serial port such as > /dev/ttyr00. > > I want to do the same thing with javax.comm or gnu.io to connect to a > virtual serial port. However I'm hitting road blocks everywhere. > javax.comm for Linux sees the virtual port, but there are transmission > errors. Tried Solaris too, but the Solaris Moxa drivers don't play > nice with javax.comm because the driver uses /dev/pts/n instead of > /dev/term/x. Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris. > > Has anyone used RXTX with serial over Ethernet devices? Any hints on > how to make it work? > > I know that I'm not completely off track because javax.comm does work > with Moxa on a Windows platform, but that's just not an option for > production deployment. > > Moxa should work under linux. There may be minor issues depending upon how complete the kernel driver is but I think it will work. One of the minor issues is /dev/ttyr00 is not enumerated. There are several work arounds documented with the source code and on the wiki. The easiest solution for testing purposes is to make a symbolic link from /dev/ttyr00 to a port that is enumerated such as /dev/ttyS129. You can later alter the rxtx source or use properties to change the enumerated ports. -- Trent Jarvi tjarvi at qbang.org From d.tonhofer at m-plify.com Sun Apr 20 03:33:30 2008 From: d.tonhofer at m-plify.com (David Tonhofer (M-PLIFY S.A.)) Date: Sun, 20 Apr 2008 11:33:30 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: <480B0DEA.5010908@m-plify.com> Jeff Larsen wrote: > Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris It might be that the Java side of RXTX does not recognize that portname. Trying modifying src/RXTXCommDriver.java as described in this case: http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card From ajmas at sympatico.ca Sun Apr 20 16:37:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Apr 2008 18:37:59 -0400 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <480B0DEA.5010908@m-plify.com> References: <480B0DEA.5010908@m-plify.com> Message-ID: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > Jeff Larsen wrote: >> Next I tried RXTX on Linux, but I'm getting >> NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX >> on Solaris > It might be that the Java side of RXTX does not recognize that > portname. > Trying modifying src/RXTXCommDriver.java as described in this case: > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card I wonder whether it would be worth allowing custom port prefixes as a system parameter? For example: gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" Andre From Martin.Oberhuber at windriver.com Tue Apr 22 12:34:36 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 22 Apr 2008 20:34:36 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> References: <480B0DEA.5010908@m-plify.com> <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE6485848056CD6CE@ism-mail03.corp.ad.wrs.com> Sounds like a great idea... I'm wondering how the "variable part" after the Prefixes could be specified though? What about allowing Regular Expression character Classes in the existing System Property for specifying ports: System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyS[0-9],ttyS[ABC],ttyUSB[0-9a-z]"); The set of allowed patterns would of course need to Be restricted compared to REGEX, because it must be A syntax that supports iterating over it. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Montag, 21. April 2008 00:38 > To: rxtx at qbang.org and Users > Subject: Re: [Rxtx] Moxa serial over Ethernet driver > > > On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > > Jeff Larsen wrote: > >> Next I tried RXTX on Linux, but I'm getting > >> NoSuchPortException connecting to /dev/ttyr00. I have yet > to try RXTX > >> on Solaris > > It might be that the Java side of RXTX does not recognize that > > portname. > > Trying modifying src/RXTXCommDriver.java as described in this case: > > > > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_ > SST-4P.2FLP_multiport_card > > I wonder whether it would be worth allowing custom port > prefixes as a > system parameter? For > example: > > gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Loi.TRAN at weatherford.com Tue Apr 22 13:10:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Tue, 22 Apr 2008 14:10:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled Message-ID: Hi, I'm currently using the Java RXTX API to interface to a serial port. The serial port is connected to a bridge board that communicates with our communications system running at 1.875 Mbps which is linked to an embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no flow control). I send a command to the embedded board through the serial-bridge board which then is relayed to the embedded board. The command sent asks the embedded board to dump a binary image. Here's where I'm hitting some problems. I've successfully done this is an integrated serial port from the laptop. The binary file that comes back is consistent on every attempt. When I use the application I've written to do the same thing with a USB-to-serial adapter, the image I get back is not the same as the image I receive through the USB-to-serial adapter is not consistent at all. A final thing is that when I use a terminal program to dump the binary image with the USB-serial adapter, the image is correct. Every time! What is the terminal program doing that's not being done in my application? My application is quite simple. Has anyone observed this behavior before? If you have, I'd like to know how you've gotten around this problem. Thanks, LT =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From tjarvi at qbang.org Tue Apr 22 21:11:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 22 Apr 2008 21:11:10 -0600 (MDT) Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org From Loi.TRAN at weatherford.com Wed Apr 23 08:35:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Wed, 23 Apr 2008 09:35:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: Thanks for all the responses. I finally tried something that worked consistently. I updated my Prolific driver and repeated my tests. It worked. If you're using the Prolific type USB-serial adapters, do no use the Prolific version 2.0.2.1 driver on Windows. Update it to the latest 2.0.2.8 version. Again, thanks for all the responses. LT -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Tuesday, April 22, 2008 10:11 PM To: TRAN, Loi X. Cc: rxtx at qbang.org Subject: Re: [Rxtx] Prolific USB - RXTX data mangled On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From Martin.Oberhuber at windriver.com Wed Apr 23 18:54:26 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 02:54:26 +0200 Subject: [Rxtx] RXTX port locking on Linux status? Message-ID: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Dear RXTX community, I'm wondering what the status is with RXTX locking serial ports on Linux? My understanding is that the mechanism used in 2.1-7r2 (lockfiles) is not really state of the art, and has lots of problems (e.g. missing permissions). There was an idea to migrate towards a Kernel syscall based solution for port locking. What's the status here? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/9878db9f/attachment-0050.html From tjarvi at qbang.org Wed Apr 23 20:32:24 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Apr 2008 20:32:24 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > Dear RXTX community, > > I'm wondering what the status is with RXTX locking > serial ports on Linux? > > My understanding is that the mechanism used in > 2.1-7r2 (lockfiles) is not really state of the art, and > has lots of problems (e.g. missing permissions). > > There was an idea to migrate towards a Kernel > syscall based solution for port locking. > > What's the status here? > Hi Martin, I'm in favor of deprecating the current FHS locking mechanism in favor of an IOCTL when available. I think it will be available on all the platforms but do not know for sure. The status is unchanged. I've had very few free cycles for such things. Feel free to take a stab at it if you have some time. I believe the IOCTL is used in the Mac OS X code already. I don't see any real backwards compatability issues and the IOCTL should just work. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Apr 24 06:14:06 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 14:14:06 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Thanks Trent. Problem is only that I'm really not at all Familiar with the C part of RXTX. If there Were anything I could do in Java for this, It would be easier for me.... ... Are there any C experts here on the list Who'd like to look at ioctl port locking For linux? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Donnerstag, 24. April 2008 04:32 > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > I'm wondering what the status is with RXTX locking > > serial ports on Linux? > > > > My understanding is that the mechanism used in > > 2.1-7r2 (lockfiles) is not really state of the art, and > > has lots of problems (e.g. missing permissions). > > > > There was an idea to migrate towards a Kernel > > syscall based solution for port locking. > > > > What's the status here? > > > > Hi Martin, > > I'm in favor of deprecating the current FHS locking mechanism > in favor of > an IOCTL when available. I think it will be available on all the > platforms but do not know for sure. > > The status is unchanged. I've had very few free cycles for > such things. > Feel free to take a stab at it if you have some time. I > believe the IOCTL > is used in the Mac OS X code already. > > I don't see any real backwards compatability issues and the > IOCTL should > just work. > > -- > Trent Jarvi > tjarvi at qbang.org > From sspies at sloc.de Thu Apr 24 07:15:36 2008 From: sspies at sloc.de (Sebastian Spies) Date: Thu, 24 Apr 2008 15:15:36 +0200 (CEST) Subject: [Rxtx] rxtx on gumstix: Interrupted system call In-Reply-To: <47FB7B20.7080504@sloc.de> References: <47FB7B20.7080504@sloc.de> Message-ID: <55445.130.83.139.205.1209042936.squirrel@ssl.sloc.de> Dear list, while porting rxtx to the gumstix, I found out, that select used in readArray in SerialImp.c might not work as expected. Maybe, because of missing TIOCSERGETLSR-support? select is often interrupted, so i wrote the following quick'n'dirty hack to make it work on gumstix: diff -Nur rxtx-2.1-7r2/src/SerialImp.c rxtx-2.1-7r2/src/SerialImp.c --- rxtx-2.1-7r2/src/SerialImp.c 2006-01-29 23:19:04.000000000 +0100 +++ rxtx-2.1-7r2-patched/src/SerialImp.c 2008-04-24 14:30:17.000000000 +0200 @@ -3380,7 +3381,7 @@ JNIEXPORT jint JNICALL RXTXPort(readArray)( JNIEnv *env, jobject jobj, jbyteArray jbarray, jint offset, jint length ) { - int bytes; + int bytes = 0; jbyte *body; /* char msg[80]; */ int fd = get_java_var( env, jobj, "fd", "I" ); @@ -3397,9 +3398,18 @@ "readArray", "Invalid length" ); return -1; } - body = (*env)->GetByteArrayElements( env, jbarray, 0 ); - bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ - (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + while(1 > bytes) + { + body = (*env)->GetByteArrayElements( env, jbarray, 0 ); + bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ + (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + // quick'n'dirty - SSP + report (" trying again... \n"); + errno = 0; + } + if( bytes < 0 ) { report( "RXTXPort:readArray bytes < 0" ); LEAVE( "RXTXPort:readArray" ); > Hey, > > I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use > RXTXPort$SerialInputStream.read(), then I get the following Exception. I > did not yet figure out which system call is interrupted as strace > produces loads of output. > > Any help would be very appreciated. Thanks in advance. > Sebastian > > > [java] java.io.IOException: Interrupted system call in readArray > [java] at gnu.io.RXTXPort.readArray(Native Method) > [java] at > gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) > [java] at > java.io.FilterInputStream.read(FilterInputStream.java:189) > [java] at > java.io.BufferedInputStream.refill(BufferedInputStream.java:371) > [java] at > java.io.BufferedInputStream.read(BufferedInputStream.java:229) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) > [java] at > com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) > > -- > Sebastian Spies > > mail: sspies at sloc.de > > > > From fire_baptized at hotmail.com Thu Apr 24 18:27:48 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Thu, 24 Apr 2008 20:27:48 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hello I am having a problem with the serial device connecting (software wise) to the serial port. However I have a test program and it seems to work just fine in that environment - and it doesnt use GUI. The error I am getting is : PortNotFoundException Now the way I have it setup in the GUI environment is that once the user pushes a JButton the program connects using this class: protected void establishConnection() { try { portId = CommPortIdentifier.getPortIdentifier("COM3"); System.out.println("Establishing connction....."); messages[0] = "\nEstablishing connction.....\n"; } catch ( NoSuchPortException noport) { System.out.println("Port not found: "+ noport); messages[0] = "Port not found: "+ noport+"\n"; } try { serialPort = (SerialPort) portId.open("serial", 50); System.out.println("Port has been found."); messages[1] = "Port has been found.\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[1] = "" +usedport; } try { serialPort = (SerialPort) portId.open("serial", 50); messages[2] = "Connecting to COM3 on port 50....\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; } try { serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); System.out.println("Esablishing the transfer rate settings for COM3."); messages[3] = "Esablishing the transfer rate settings for COM3.\n"; } catch (UnsupportedCommOperationException nosupcom) { System.out.println(nosupcom); System.out.println("The tranfer rate could not be esblished on COM3."); messages[3] = "The tranfer rate could not be esblished on COM3.\n"; } System.out.println(serialPort.getFlowControlMode()); messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; //sendDataOut(buffer[3],buffer[4]); } I need all the data in this method (and all the string values in this method) to be printed out on a JTextArea. I wont do me any good if not all the text is printed on a JTextArea in another class. So I have the text printing the JTextArea correctly, but everytime the JButton is activated - it gives me that error message. I did add a disconnect button that is supposed to call the serialPort.close(). _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/273fd4ec/attachment-0049.html From tjarvi at qbang.org Thu Apr 24 21:54:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Apr 2008 21:54:10 -0600 (MDT) Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > Hello I am having a problem with the serial device connecting (software > wise) to the serial port. However I have a test program and it seems to > work just fine in that environment - and it doesnt use GUI. The error I > am getting is : PortNotFoundException Now the way I have it setup in the > GUI environment is that once the user pushes a JButton the program > connects using this class: > > protected void establishConnection() { > try { > portId = CommPortIdentifier.getPortIdentifier("COM3"); > System.out.println("Establishing connction....."); > messages[0] = "\nEstablishing connction.....\n"; > } > catch ( NoSuchPortException noport) { > System.out.println("Port not found: "+ noport); > messages[0] = "Port not found: "+ noport+"\n"; > } > try { > serialPort = (SerialPort) portId.open("serial", 50); > System.out.println("Port has been found."); > messages[1] = "Port has been found.\n"; > } > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[1] = "" +usedport; > } ================================================================= > try { > serialPort = (SerialPort) portId.open("serial", 50); > messages[2] = "Connecting to COM3 on port 50....\n"; > } ================================================================== > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > } > try { > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > System.out.println("Esablishing the transfer rate settings for COM3."); > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > } > catch (UnsupportedCommOperationException nosupcom) { > System.out.println(nosupcom); > System.out.println("The tranfer rate could not be esblished on COM3."); > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > } > System.out.println(serialPort.getFlowControlMode()); > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > //sendDataOut(buffer[3],buffer[4]); > } > > I need all the data in this method (and all the string values in this > method) to be printed out on a JTextArea. I wont do me any good if not > all the text is printed on a JTextArea in another class. So I have the > text printing the JTextArea correctly, but everytime the JButton is > activated - it gives me that error message. I did add a disconnect > button that is supposed to call the serialPort.close(). > The open code used twice is going to throw an exception. It may be that you catch the exception above this code and print a confusing message? A common mistake is people will accidently run two copies of their program. The first instance of the program will open the port and prevent enumeration (finding the port) in the second instance of the program. As an example, you may be running your text based application which is preventing the GUI from seeing the port. Enumeration is done by trying to open the port. If the port is open, Enumeration fails. -- Trent Jarvi tjarvi at qbang.org From fire_baptized at hotmail.com Thu Apr 24 22:32:05 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 00:32:05 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Wow - thanks dude what a dumb thing for me to not catch..... now here is the current problem - right now I am trying to output data again one is with the test program - and it seems that serialPort.setRTS(true); is throwing an exceptions there - now if I show this code please bare in mind that I am only testing - the code is kinda sloppy in my mind - but if I can figure out why calling this function is throwing an exception then maybe I can figure out why my GUI application is getting the same null pointer exceptions when try to send out the data stream. FYI Trent this email is not directed towards you - anyone can jump in on this public static void main(String args[]) { byte[] b = new byte[64]; int keyinput = 0 ; byte x = 0; byte y = 0; PortTesting1 testports = new PortTesting1(); try { joyskoro = Joystick.createInstance(); } catch (IOException ioexc) { System.out.println("There is an input/output problem: " + ioexc); } while (true) { joyskoro.poll(); b[0] = ((byte) -(10 * joyskoro.getY())); b[1] = ((byte) (10 * joyskoro.getX())); System.out.println("The 3rd byte is: " +b[0]); System.out.println("The 4rd byte is: " +b[1]); serialPort.setRTS(true); // HERE IS WHERE THE PROBLEM IS !!!!!!! ON THIS LINE but if I dont have it active in my program the Bluetooth device (that is System.out.println("Ready to send :-) !"); //connected to the serial port does not send out data!!!!! if (joyskoro.isButtonDown(joyskoro.BUTTON10)) { System.out.println("Connection terminated."); serialPort.close(); break; } if (joyskoro.isButtonDown(joyskoro.BUTTON2)) { boolean flag = true; //reading from key input from the keyboard System.out.println("Please input a command: "); while (flag) { try { keyinput = System.in.read(); } catch (IOException ioexc) {/*there is no need to put * anything here */ } if((char)keyinput=='w') { pushIt((byte)85); } if((char)keyinput=='s') { pushIt((byte)84); } if((char)keyinput=='a') { pushIt((byte)83); } if((char)keyinput=='d') { pushIt((byte)82); } if((char)keyinput=='q') { pushIt((byte)89); } if((char)keyinput=='\t') { //this stop reading input from the keyboard flag = false; } } and help anyways here is the block of code that throwing an exception for the test program: > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/5c8f7d68/attachment-0049.html From fire_baptized at hotmail.com Fri Apr 25 07:59:53 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 09:59:53 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Are there any examples of how to push out data? As in using input and output streams - if I can compare code maybe I can see where this is causing a problem. I have a byte array that I am pushing out data. I keep getting null pointer exceptions every where I turn. > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/22228ab6/attachment-0048.html From ajmas at sympatico.ca Sat Apr 26 07:37:09 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 26 Apr 2008 09:37:09 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hi, On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote: > > Are there any examples of how to push out data? As in using input > and output streams - if I can compare code maybe I can see where > this is causing a problem. I have a byte array that I am pushing > out data. I keep getting null pointer exceptions every where I turn. > There are some examples here that might be of help: http://rxtx.qbang.org/wiki/index.php/Examples Andre From fire_baptized at hotmail.com Sat Apr 26 20:13:54 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Sat, 26 Apr 2008 22:13:54 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: looked at those....yep didnt help - I need to push out data with GUI and not get a null pointer exception everytime I try. > CC: rxtx at qbang.org> From: ajmas at sympatico.ca> To: fire_baptized at hotmail.com> Subject: Re: [Rxtx] Serial Problems with Gui.....> Date: Sat, 26 Apr 2008 09:37:09 -0400> > Hi,> > > On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote:> >> > Are there any examples of how to push out data? As in using input > > and output streams - if I can compare code maybe I can see where > > this is causing a problem. I have a byte array that I am pushing > > out data. I keep getting null pointer exceptions every where I turn.> >> > There are some examples here that might be of help:> > http://rxtx.qbang.org/wiki/index.php/Examples> > Andre _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080426/09f95b41/attachment-0047.html From michael.erskine at ketech.com Mon Apr 28 02:47:22 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 28 Apr 2008 09:47:22 +0100 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D426EF3CBBC5@no-sv-03.ketech.local> Jesrael D. Summerhill wrote: > looked at those....yep didnt help - I need to push out data with GUI and > not get a null pointer exception everytime I try. So it seems pretty obvious that your code needs to check for nulls wherever one may occur and report what's happening. Alternatively, catch the npe and display the stack trace. Then you can fix your code so it doesn't try to work with something that ain't there. Regards, Michael Erskine. From scldad at sdc.com.au Mon Apr 28 03:58:34 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Mon, 28 Apr 2008 19:28:34 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Message-ID: <200804281928.34454.scldad@sdc.com.au> Has anybody done any design work on this? The first thing that springs to mind is that we still need to check for lock files because other apps tend to use that approach even if we go to ioctl. Cheers, Stephen Davies On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > Thanks Trent. > > Problem is only that I'm really not at all > Familiar with the C part of RXTX. If there > Were anything I could do in Java for this, > It would be easier for me.... > > ... Are there any C experts here on the list > Who'd like to look at ioctl port locking > For linux? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > -----Original Message----- > > From: Trent Jarvi [mailto:tjarvi at qbang.org] > > Sent: Donnerstag, 24. April 2008 04:32 > > To: Oberhuber, Martin > > Cc: rxtx at qbang.org > > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > > > I'm wondering what the status is with RXTX locking > > > serial ports on Linux? > > > > > > My understanding is that the mechanism used in > > > 2.1-7r2 (lockfiles) is not really state of the art, and > > > has lots of problems (e.g. missing permissions). > > > > > > There was an idea to migrate towards a Kernel > > > syscall based solution for port locking. > > > > > > What's the status here? > > > > Hi Martin, > > > > I'm in favor of deprecating the current FHS locking mechanism > > in favor of > > an IOCTL when available. I think it will be available on all the > > platforms but do not know for sure. > > > > The status is unchanged. I've had very few free cycles for > > such things. > > Feel free to take a stab at it if you have some time. I > > believe the IOCTL > > is used in the Mac OS X code already. > > > > I don't see any real backwards compatability issues and the > > IOCTL should > > just work. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Mon Apr 28 04:21:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 28 Apr 2008 04:21:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804281928.34454.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: I don't think there would need to be any architectural changes. A couple ifdefs and minor changes in the current code should be enough. Proposal: FHS/UUCP locks: continue to respect them, try to create them but do not error if the IOCTL is supported. (But does the IOCTL being defined mean it will work?) Enumeration: Do not assert the IOCTL while opening. Serial.open: assert the IOCTL after open. Continue to use locks as described above after asserting the IOCTL. If the IOCTL is defined but not working, handle it here. Failure cases include the IOCTL is not supported and the port is already locked. On Mon, 28 Apr 2008, Stephen Davies wrote: > Has anybody done any design work on this? > The first thing that springs to mind is that we still need to check for lock > files because other apps tend to use that approach even if we go to ioctl. > > Cheers, > Stephen Davies > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: >> Thanks Trent. >> >> Problem is only that I'm really not at all >> Familiar with the C part of RXTX. If there >> Were anything I could do in Java for this, >> It would be easier for me.... >> >> ... Are there any C experts here on the list >> Who'd like to look at ioctl port locking >> For linux? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >>> -----Original Message----- >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] >>> Sent: Donnerstag, 24. April 2008 04:32 >>> To: Oberhuber, Martin >>> Cc: rxtx at qbang.org >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? >>> >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: >>>> Dear RXTX community, >>>> >>>> I'm wondering what the status is with RXTX locking >>>> serial ports on Linux? >>>> >>>> My understanding is that the mechanism used in >>>> 2.1-7r2 (lockfiles) is not really state of the art, and >>>> has lots of problems (e.g. missing permissions). >>>> >>>> There was an idea to migrate towards a Kernel >>>> syscall based solution for port locking. >>>> >>>> What's the status here? >>> >>> Hi Martin, >>> >>> I'm in favor of deprecating the current FHS locking mechanism >>> in favor of >>> an IOCTL when available. I think it will be available on all the >>> platforms but do not know for sure. >>> >>> The status is unchanged. I've had very few free cycles for >>> such things. >>> Feel free to take a stab at it if you have some time. I >>> believe the IOCTL >>> is used in the Mac OS X code already. >>> >>> I don't see any real backwards compatability issues and the >>> IOCTL should >>> just work. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Tue Apr 29 12:04:04 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Apr 2008 20:04:04 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Hi all, The biggest problem that I have seen with lockfiles on Linux At least is, that it seems there is no standard with respect To the folder in which they should be created. Also, many Distributions seem to set up file system permissions in such A way that writing to the lockfile folder is not allowed for The normal user -- that's why we stopped using lockfiles In our commercial product. If we are to still respect lockfiles, we first need to Understand where we are expected to look for them. Does Anybody have any insight what variants of lockfile folder Schema exist out there in the wild? Some apps like minicom Seem to even allow users to manually specify a lockfile Folder of their choice. Because of the difficulty finding the right lockfile folder, And because of the inherent risk of thinking that something Might be locked while it actually isn't, I'd suggest that RXTX should have a "soft-off" feature that allows disabling ALL Lockfile checks at runtime without recompiling the native Sharedlibs. Trent - I like your strategy outline, but I think that it Needs to be configurable by the client such that users and/or Customer Support can disable lockfiles / disable ioctl in Case they detect that they are runing on an OS / Kernal that Does not support one or the other. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Montag, 28. April 2008 12:22 > To: Stephen Davies > Cc: rxtx at qbang.org; Oberhuber, Martin; Trent Jarvi > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > I don't think there would need to be any architectural > changes. A couple > ifdefs and minor changes in the current code should be enough. > > Proposal: > > FHS/UUCP locks: > continue to respect them, try to create them but do not error if > the IOCTL is supported. (But does the IOCTL being defined mean > it will work?) > Enumeration: > Do not assert the IOCTL while opening. > Serial.open: > assert the IOCTL after open. Continue to use locks as described > above after asserting the IOCTL. If the IOCTL is defined but > not working, handle it here. Failure cases include the IOCTL > is not supported and the port is already locked. > > On Mon, 28 Apr 2008, Stephen Davies wrote: > > > Has anybody done any design work on this? > > The first thing that springs to mind is that we still need > to check for lock > > files because other apps tend to use that approach even if > we go to ioctl. > > > > Cheers, > > Stephen Davies > > > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > >> Thanks Trent. > >> > >> Problem is only that I'm really not at all > >> Familiar with the C part of RXTX. If there > >> Were anything I could do in Java for this, > >> It would be easier for me.... > >> > >> ... Are there any C experts here on the list > >> Who'd like to look at ioctl port locking > >> For linux? > >> > >> Thanks, > >> -- > >> Martin Oberhuber, Senior Member of Technical Staff, Wind River > >> Target Management Project Lead, DSDP PMC Member > >> http://www.eclipse.org/dsdp/tm > >> > >>> -----Original Message----- > >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] > >>> Sent: Donnerstag, 24. April 2008 04:32 > >>> To: Oberhuber, Martin > >>> Cc: rxtx at qbang.org > >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? > >>> > >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > >>>> Dear RXTX community, > >>>> > >>>> I'm wondering what the status is with RXTX locking > >>>> serial ports on Linux? > >>>> > >>>> My understanding is that the mechanism used in > >>>> 2.1-7r2 (lockfiles) is not really state of the art, and > >>>> has lots of problems (e.g. missing permissions). > >>>> > >>>> There was an idea to migrate towards a Kernel > >>>> syscall based solution for port locking. > >>>> > >>>> What's the status here? > >>> > >>> Hi Martin, > >>> > >>> I'm in favor of deprecating the current FHS locking mechanism > >>> in favor of > >>> an IOCTL when available. I think it will be available on all the > >>> platforms but do not know for sure. > >>> > >>> The status is unchanged. I've had very few free cycles for > >>> such things. > >>> Feel free to take a stab at it if you have some time. I > >>> believe the IOCTL > >>> is used in the Mac OS X code already. > >>> > >>> I don't see any real backwards compatability issues and the > >>> IOCTL should > >>> just work. > >>> > >>> -- > >>> Trent Jarvi > >>> tjarvi at qbang.org > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > From Steffen.DETTMER at ingenico.com Tue Apr 29 13:34:44 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 29 Apr 2008 21:34:44 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Message-ID: <20080429193444.GU2928@elberon.bln.de.ingenico.com> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > The biggest problem that I have seen with lockfiles on Linux > At least is, that it seems there is no standard with respect > To the folder in which they should be created. Also, many > Distributions seem to set up file system permissions in such > A way that writing to the lockfile folder is not allowed for > The normal user -- that's why we stopped using lockfiles > In our commercial product. It seems it depends on the expectations. I consider it as a feature that by default a linux user cannot access serial ports. Maybe root connected a modem (can produce phone bills) or even some serial card reader, maybe with the web servers key pair. I would expect that by default a user cannot open the serial port because of insufficient permissions on the device file. I would expect this on other unices as well (but I don't know it). For windows I think it should be similar but not impacting so much in practice, because often windows users work with big permissions on a somewhat high priviledge level or even Administrator. > If we are to still respect lockfiles, we first need to > Understand where we are expected to look for them. Does > Anybody have any insight what variants of lockfile folder > Schema exist out there in the wild? Some apps like minicom > Seem to even allow users to manually specify a lockfile > Folder of their choice. At least my (ancient) minicom does not allow the user to change this option, it is displayed but read-only, but root is allowed to change it. > Because of the difficulty finding the right lockfile folder, > And because of the inherent risk of thinking that something > Might be locked while it actually isn't, I'd suggest that > RXTX should have a "soft-off" feature that allows disabling > ALL Lockfile checks at runtime without recompiling the native > Sharedlibs. sounds very reasonable, yes... and as admin I would not wish that users could skip such locking because they do things wrong by default ;) (in the end I guess that is related to the dilemma, that hotplug/user-owned-periphery and multi-user systems simply conflict) > Trent - I like your strategy outline, but I think that it > Needs to be configurable by the client such that users and/or > Customer Support can disable lockfiles / disable ioctl in > Case they detect that they are runing on an OS / Kernal that > Does not support one or the other. Yes, this would be good I guess... Applications could offer configuration options to control that, maybe similarily as minicom. BTW, man minicom tells: *B - Lock file location On most systems This should be /usr/spool/uucp. Linux systems use /var/lock. If this directory does not exist, minicom will not attempt to use lockfiles. The statement `Linux systems use /var/lock' is interesting, does anyone know the source of this convention? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Tue Apr 29 16:11:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Apr 2008 16:11:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? These details are outlined in the Filesystem Hierarchy Standard (FHS). http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLOCKLOCKFILES -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Tue Apr 29 18:58:09 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Wed, 30 Apr 2008 10:28:09 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: <200804301028.09307.scldad@sdc.com.au> I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is the same. Any ideas as to how to handle this? Stephen On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: > * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > > The biggest problem that I have seen with lockfiles on Linux > > At least is, that it seems there is no standard with respect > > To the folder in which they should be created. Also, many > > Distributions seem to set up file system permissions in such > > A way that writing to the lockfile folder is not allowed for > > The normal user -- that's why we stopped using lockfiles > > In our commercial product. > > It seems it depends on the expectations. I consider it as a > feature that by default a linux user cannot access serial ports. > Maybe root connected a modem (can produce phone bills) or even > some serial card reader, maybe with the web servers key pair. > > I would expect that by default a user cannot open the serial port > because of insufficient permissions on the device file. I would > expect this on other unices as well (but I don't know it). > > For windows I think it should be similar but not impacting so > much in practice, because often windows users work with big > permissions on a somewhat high priviledge level or even > Administrator. > > > If we are to still respect lockfiles, we first need to > > Understand where we are expected to look for them. Does > > Anybody have any insight what variants of lockfile folder > > Schema exist out there in the wild? Some apps like minicom > > Seem to even allow users to manually specify a lockfile > > Folder of their choice. > > At least my (ancient) minicom does not allow the user to change > this option, it is displayed but read-only, but root is allowed > to change it. > > > Because of the difficulty finding the right lockfile folder, > > And because of the inherent risk of thinking that something > > Might be locked while it actually isn't, I'd suggest that > > RXTX should have a "soft-off" feature that allows disabling > > ALL Lockfile checks at runtime without recompiling the native > > Sharedlibs. > > sounds very reasonable, yes... > and as admin I would not wish that users could skip such > locking because they do things wrong by default ;) > > (in the end I guess that is related to the dilemma, that > hotplug/user-owned-periphery and multi-user systems simply > conflict) > > > Trent - I like your strategy outline, but I think that it > > Needs to be configurable by the client such that users and/or > > Customer Support can disable lockfiles / disable ioctl in > > Case they detect that they are runing on an OS / Kernal that > > Does not support one or the other. > > Yes, this would be good I guess... Applications could offer > configuration options to control that, maybe similarily as > minicom. > > BTW, man minicom tells: > > *B - Lock file location > On most systems This should be /usr/spool/uucp. > Linux systems use /var/lock. If this directory > does not exist, minicom will not attempt to use > lockfiles. > > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure > and expedient electronic transaction acceptance. Ingenico products leverage > proven technology, established standards and unparalleled ergonomics to > provide optimal reliability, versatility and usability. This comprehensive > range of products is complemented by a global array of services and > partnerships, enabling businesses in a number of vertical sectors to accept > transactions anywhere their business takes them. www.ingenico.com This > message may contain confidential and/or privileged information. If you are > not the addressee or authorized to receive this for the addressee, you must > not use, copy, disclose or take any action based on this message or any > information herein. If you have received this message in error, please > advise the sender immediately by reply e-mail and delete this message. > Thank you for your cooperation. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Wed Apr 30 19:30:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 30 Apr 2008 19:30:51 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804301028.09307.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> <200804301028.09307.scldad@sdc.com.au> Message-ID: Hi Stephen, I suspect ioctl/TIOCEXCL open/O_EXCL would do the job. Mac uses TIOCEXCL and it is POSIX. We use O_EXCL for lockfiles on Linux already. On Wed, 30 Apr 2008, Stephen Davies wrote: > I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is > the same. > > Any ideas as to how to handle this? > > Stephen > > > On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: >> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: >>> The biggest problem that I have seen with lockfiles on Linux >>> At least is, that it seems there is no standard with respect >>> To the folder in which they should be created. Also, many >>> Distributions seem to set up file system permissions in such >>> A way that writing to the lockfile folder is not allowed for >>> The normal user -- that's why we stopped using lockfiles >>> In our commercial product. >> >> It seems it depends on the expectations. I consider it as a >> feature that by default a linux user cannot access serial ports. >> Maybe root connected a modem (can produce phone bills) or even >> some serial card reader, maybe with the web servers key pair. >> >> I would expect that by default a user cannot open the serial port >> because of insufficient permissions on the device file. I would >> expect this on other unices as well (but I don't know it). >> >> For windows I think it should be similar but not impacting so >> much in practice, because often windows users work with big >> permissions on a somewhat high priviledge level or even >> Administrator. >> >>> If we are to still respect lockfiles, we first need to >>> Understand where we are expected to look for them. Does >>> Anybody have any insight what variants of lockfile folder >>> Schema exist out there in the wild? Some apps like minicom >>> Seem to even allow users to manually specify a lockfile >>> Folder of their choice. >> >> At least my (ancient) minicom does not allow the user to change >> this option, it is displayed but read-only, but root is allowed >> to change it. >> >>> Because of the difficulty finding the right lockfile folder, >>> And because of the inherent risk of thinking that something >>> Might be locked while it actually isn't, I'd suggest that >>> RXTX should have a "soft-off" feature that allows disabling >>> ALL Lockfile checks at runtime without recompiling the native >>> Sharedlibs. >> >> sounds very reasonable, yes... >> and as admin I would not wish that users could skip such >> locking because they do things wrong by default ;) >> >> (in the end I guess that is related to the dilemma, that >> hotplug/user-owned-periphery and multi-user systems simply >> conflict) >> >>> Trent - I like your strategy outline, but I think that it >>> Needs to be configurable by the client such that users and/or >>> Customer Support can disable lockfiles / disable ioctl in >>> Case they detect that they are runing on an OS / Kernal that >>> Does not support one or the other. >> >> Yes, this would be good I guess... Applications could offer >> configuration options to control that, maybe similarily as >> minicom. >> >> BTW, man minicom tells: >> >> *B - Lock file location >> On most systems This should be /usr/spool/uucp. >> Linux systems use /var/lock. If this directory >> does not exist, minicom will not attempt to use >> lockfiles. >> >> The statement `Linux systems use /var/lock' is interesting, does >> anyone know the source of this convention? >> >> oki, >> >> Steffen >> >> About Ingenico Throughout the world businesses rely on Ingenico for secure >> and expedient electronic transaction acceptance. Ingenico products leverage >> proven technology, established standards and unparalleled ergonomics to >> provide optimal reliability, versatility and usability. This comprehensive >> range of products is complemented by a global array of services and >> partnerships, enabling businesses in a number of vertical sectors to accept >> transactions anywhere their business takes them. www.ingenico.com This >> message may contain confidential and/or privileged information. If you are >> not the addressee or authorized to receive this for the addressee, you must >> not use, copy, disclose or take any action based on this message or any >> information herein. If you have received this message in error, please >> advise the sender immediately by reply e-mail and delete this message. >> Thank you for your cooperation. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0073.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0071.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0058.html From pboulton at pulsetracer.com Fri Apr 18 14:30:13 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Fri, 18 Apr 2008 13:30:13 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site Message-ID: <480904D5.1060307@pulsetracer.com> Hello, gentle serial porters. I have downloaded the zipped up binaries for use on Windows without Sun's CommAPI, but don't seem able to extract anything from the download. Go to main page, http://www.rxtx.org/ Click on Downloads I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) And I save it to disk. If I try and extract the files with WinZip, Winzip thinks the archive is corrupt. If I try using Windows Explorer, I am able to extract it into a single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than the original .zip. Any help would be much appreciated. Sincerely, Philip Boulton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080418/97d89793/attachment-0056.html From tjarvi at qbang.org Fri Apr 18 19:07:00 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 18 Apr 2008 19:07:00 -0600 (MDT) Subject: [Rxtx] Difficulty opening zip file at rxtx site In-Reply-To: <480904D5.1060307@pulsetracer.com> References: <480904D5.1060307@pulsetracer.com> Message-ID: On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org From pboulton at pulsetracer.com Sat Apr 19 12:46:26 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Sat, 19 Apr 2008 11:46:26 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site References: <480904D5.1060307@pulsetracer.com> Message-ID: <53DB7576450695419E09299104043761A78533@ZTGSERVER.ztg.local> I have been able to get my hands on the binaries, by going to the ftp directory /pub/rxtx at ftp.qbang.org,, and ftping the file rxtx-2.1-7-bins-r2.zip . This opens happily with Winzip, and extracts as the set of files that you describe below. I only experience the ill-formed archive problem by clicking the link on the rxtx.org Downloads page (http://rxtx.qbang.org/pub/rxtx/ rxtx-2.1-7-bins-r2.zip ). Not sure what to make of that. Philip Boulton ________________________________ From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Fri 4/18/2008 6:07 PM To: Philip Boulton Cc: rxtx at qbang.org Subject: Re: [Rxtx] Difficulty opening zip file at rxtx site On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080419/147923bb/attachment-0055.html From jlar310 at gmail.com Sat Apr 19 19:11:55 2008 From: jlar310 at gmail.com (Jeff Larsen) Date: Sat, 19 Apr 2008 20:11:55 -0500 Subject: [Rxtx] Moxa serial over Ethernet driver Message-ID: Hi all, I've been using javax.comm for years to communicate with a legacy radio data system. We want to migrate the java side of the system to a VMware Server virtual machine. We've had great success using Moxa DE-303 and 5610 serial over Ethernet appliances and virtual machines for running hylafax. The OS (Linux in this case) uses a kernel driver to communicate with the Moxa via a virtual serial port such as /dev/ttyr00. I want to do the same thing with javax.comm or gnu.io to connect to a virtual serial port. However I'm hitting road blocks everywhere. javax.comm for Linux sees the virtual port, but there are transmission errors. Tried Solaris too, but the Solaris Moxa drivers don't play nice with javax.comm because the driver uses /dev/pts/n instead of /dev/term/x. Next I tried RXTX on Linux, but I'm getting NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX on Solaris. Has anyone used RXTX with serial over Ethernet devices? Any hints on how to make it work? I know that I'm not completely off track because javax.comm does work with Moxa on a Windows platform, but that's just not an option for production deployment. -- Jeff From tjarvi at qbang.org Sat Apr 19 21:08:41 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 19 Apr 2008 21:08:41 -0600 (MDT) Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: yOn Sat, 19 Apr 2008, Jeff Larsen wrote: > Hi all, > > I've been using javax.comm for years to communicate with a legacy > radio data system. We want to migrate the java side of the system to a > VMware Server virtual machine. We've had great success using Moxa > DE-303 and 5610 serial over Ethernet appliances and virtual machines > for running hylafax. The OS (Linux in this case) uses a kernel driver > to communicate with the Moxa via a virtual serial port such as > /dev/ttyr00. > > I want to do the same thing with javax.comm or gnu.io to connect to a > virtual serial port. However I'm hitting road blocks everywhere. > javax.comm for Linux sees the virtual port, but there are transmission > errors. Tried Solaris too, but the Solaris Moxa drivers don't play > nice with javax.comm because the driver uses /dev/pts/n instead of > /dev/term/x. Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris. > > Has anyone used RXTX with serial over Ethernet devices? Any hints on > how to make it work? > > I know that I'm not completely off track because javax.comm does work > with Moxa on a Windows platform, but that's just not an option for > production deployment. > > Moxa should work under linux. There may be minor issues depending upon how complete the kernel driver is but I think it will work. One of the minor issues is /dev/ttyr00 is not enumerated. There are several work arounds documented with the source code and on the wiki. The easiest solution for testing purposes is to make a symbolic link from /dev/ttyr00 to a port that is enumerated such as /dev/ttyS129. You can later alter the rxtx source or use properties to change the enumerated ports. -- Trent Jarvi tjarvi at qbang.org From d.tonhofer at m-plify.com Sun Apr 20 03:33:30 2008 From: d.tonhofer at m-plify.com (David Tonhofer (M-PLIFY S.A.)) Date: Sun, 20 Apr 2008 11:33:30 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: <480B0DEA.5010908@m-plify.com> Jeff Larsen wrote: > Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris It might be that the Java side of RXTX does not recognize that portname. Trying modifying src/RXTXCommDriver.java as described in this case: http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card From ajmas at sympatico.ca Sun Apr 20 16:37:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Apr 2008 18:37:59 -0400 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <480B0DEA.5010908@m-plify.com> References: <480B0DEA.5010908@m-plify.com> Message-ID: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > Jeff Larsen wrote: >> Next I tried RXTX on Linux, but I'm getting >> NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX >> on Solaris > It might be that the Java side of RXTX does not recognize that > portname. > Trying modifying src/RXTXCommDriver.java as described in this case: > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card I wonder whether it would be worth allowing custom port prefixes as a system parameter? For example: gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" Andre From Martin.Oberhuber at windriver.com Tue Apr 22 12:34:36 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 22 Apr 2008 20:34:36 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> References: <480B0DEA.5010908@m-plify.com> <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE6485848056CD6CE@ism-mail03.corp.ad.wrs.com> Sounds like a great idea... I'm wondering how the "variable part" after the Prefixes could be specified though? What about allowing Regular Expression character Classes in the existing System Property for specifying ports: System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyS[0-9],ttyS[ABC],ttyUSB[0-9a-z]"); The set of allowed patterns would of course need to Be restricted compared to REGEX, because it must be A syntax that supports iterating over it. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Montag, 21. April 2008 00:38 > To: rxtx at qbang.org and Users > Subject: Re: [Rxtx] Moxa serial over Ethernet driver > > > On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > > Jeff Larsen wrote: > >> Next I tried RXTX on Linux, but I'm getting > >> NoSuchPortException connecting to /dev/ttyr00. I have yet > to try RXTX > >> on Solaris > > It might be that the Java side of RXTX does not recognize that > > portname. > > Trying modifying src/RXTXCommDriver.java as described in this case: > > > > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_ > SST-4P.2FLP_multiport_card > > I wonder whether it would be worth allowing custom port > prefixes as a > system parameter? For > example: > > gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Loi.TRAN at weatherford.com Tue Apr 22 13:10:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Tue, 22 Apr 2008 14:10:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled Message-ID: Hi, I'm currently using the Java RXTX API to interface to a serial port. The serial port is connected to a bridge board that communicates with our communications system running at 1.875 Mbps which is linked to an embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no flow control). I send a command to the embedded board through the serial-bridge board which then is relayed to the embedded board. The command sent asks the embedded board to dump a binary image. Here's where I'm hitting some problems. I've successfully done this is an integrated serial port from the laptop. The binary file that comes back is consistent on every attempt. When I use the application I've written to do the same thing with a USB-to-serial adapter, the image I get back is not the same as the image I receive through the USB-to-serial adapter is not consistent at all. A final thing is that when I use a terminal program to dump the binary image with the USB-serial adapter, the image is correct. Every time! What is the terminal program doing that's not being done in my application? My application is quite simple. Has anyone observed this behavior before? If you have, I'd like to know how you've gotten around this problem. Thanks, LT =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From tjarvi at qbang.org Tue Apr 22 21:11:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 22 Apr 2008 21:11:10 -0600 (MDT) Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org From Loi.TRAN at weatherford.com Wed Apr 23 08:35:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Wed, 23 Apr 2008 09:35:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: Thanks for all the responses. I finally tried something that worked consistently. I updated my Prolific driver and repeated my tests. It worked. If you're using the Prolific type USB-serial adapters, do no use the Prolific version 2.0.2.1 driver on Windows. Update it to the latest 2.0.2.8 version. Again, thanks for all the responses. LT -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Tuesday, April 22, 2008 10:11 PM To: TRAN, Loi X. Cc: rxtx at qbang.org Subject: Re: [Rxtx] Prolific USB - RXTX data mangled On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From Martin.Oberhuber at windriver.com Wed Apr 23 18:54:26 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 02:54:26 +0200 Subject: [Rxtx] RXTX port locking on Linux status? Message-ID: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Dear RXTX community, I'm wondering what the status is with RXTX locking serial ports on Linux? My understanding is that the mechanism used in 2.1-7r2 (lockfiles) is not really state of the art, and has lots of problems (e.g. missing permissions). There was an idea to migrate towards a Kernel syscall based solution for port locking. What's the status here? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/9878db9f/attachment-0051.html From tjarvi at qbang.org Wed Apr 23 20:32:24 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Apr 2008 20:32:24 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > Dear RXTX community, > > I'm wondering what the status is with RXTX locking > serial ports on Linux? > > My understanding is that the mechanism used in > 2.1-7r2 (lockfiles) is not really state of the art, and > has lots of problems (e.g. missing permissions). > > There was an idea to migrate towards a Kernel > syscall based solution for port locking. > > What's the status here? > Hi Martin, I'm in favor of deprecating the current FHS locking mechanism in favor of an IOCTL when available. I think it will be available on all the platforms but do not know for sure. The status is unchanged. I've had very few free cycles for such things. Feel free to take a stab at it if you have some time. I believe the IOCTL is used in the Mac OS X code already. I don't see any real backwards compatability issues and the IOCTL should just work. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Apr 24 06:14:06 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 14:14:06 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Thanks Trent. Problem is only that I'm really not at all Familiar with the C part of RXTX. If there Were anything I could do in Java for this, It would be easier for me.... ... Are there any C experts here on the list Who'd like to look at ioctl port locking For linux? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Donnerstag, 24. April 2008 04:32 > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > I'm wondering what the status is with RXTX locking > > serial ports on Linux? > > > > My understanding is that the mechanism used in > > 2.1-7r2 (lockfiles) is not really state of the art, and > > has lots of problems (e.g. missing permissions). > > > > There was an idea to migrate towards a Kernel > > syscall based solution for port locking. > > > > What's the status here? > > > > Hi Martin, > > I'm in favor of deprecating the current FHS locking mechanism > in favor of > an IOCTL when available. I think it will be available on all the > platforms but do not know for sure. > > The status is unchanged. I've had very few free cycles for > such things. > Feel free to take a stab at it if you have some time. I > believe the IOCTL > is used in the Mac OS X code already. > > I don't see any real backwards compatability issues and the > IOCTL should > just work. > > -- > Trent Jarvi > tjarvi at qbang.org > From sspies at sloc.de Thu Apr 24 07:15:36 2008 From: sspies at sloc.de (Sebastian Spies) Date: Thu, 24 Apr 2008 15:15:36 +0200 (CEST) Subject: [Rxtx] rxtx on gumstix: Interrupted system call In-Reply-To: <47FB7B20.7080504@sloc.de> References: <47FB7B20.7080504@sloc.de> Message-ID: <55445.130.83.139.205.1209042936.squirrel@ssl.sloc.de> Dear list, while porting rxtx to the gumstix, I found out, that select used in readArray in SerialImp.c might not work as expected. Maybe, because of missing TIOCSERGETLSR-support? select is often interrupted, so i wrote the following quick'n'dirty hack to make it work on gumstix: diff -Nur rxtx-2.1-7r2/src/SerialImp.c rxtx-2.1-7r2/src/SerialImp.c --- rxtx-2.1-7r2/src/SerialImp.c 2006-01-29 23:19:04.000000000 +0100 +++ rxtx-2.1-7r2-patched/src/SerialImp.c 2008-04-24 14:30:17.000000000 +0200 @@ -3380,7 +3381,7 @@ JNIEXPORT jint JNICALL RXTXPort(readArray)( JNIEnv *env, jobject jobj, jbyteArray jbarray, jint offset, jint length ) { - int bytes; + int bytes = 0; jbyte *body; /* char msg[80]; */ int fd = get_java_var( env, jobj, "fd", "I" ); @@ -3397,9 +3398,18 @@ "readArray", "Invalid length" ); return -1; } - body = (*env)->GetByteArrayElements( env, jbarray, 0 ); - bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ - (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + while(1 > bytes) + { + body = (*env)->GetByteArrayElements( env, jbarray, 0 ); + bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ + (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + // quick'n'dirty - SSP + report (" trying again... \n"); + errno = 0; + } + if( bytes < 0 ) { report( "RXTXPort:readArray bytes < 0" ); LEAVE( "RXTXPort:readArray" ); > Hey, > > I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use > RXTXPort$SerialInputStream.read(), then I get the following Exception. I > did not yet figure out which system call is interrupted as strace > produces loads of output. > > Any help would be very appreciated. Thanks in advance. > Sebastian > > > [java] java.io.IOException: Interrupted system call in readArray > [java] at gnu.io.RXTXPort.readArray(Native Method) > [java] at > gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) > [java] at > java.io.FilterInputStream.read(FilterInputStream.java:189) > [java] at > java.io.BufferedInputStream.refill(BufferedInputStream.java:371) > [java] at > java.io.BufferedInputStream.read(BufferedInputStream.java:229) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) > [java] at > com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) > > -- > Sebastian Spies > > mail: sspies at sloc.de > > > > From fire_baptized at hotmail.com Thu Apr 24 18:27:48 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Thu, 24 Apr 2008 20:27:48 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hello I am having a problem with the serial device connecting (software wise) to the serial port. However I have a test program and it seems to work just fine in that environment - and it doesnt use GUI. The error I am getting is : PortNotFoundException Now the way I have it setup in the GUI environment is that once the user pushes a JButton the program connects using this class: protected void establishConnection() { try { portId = CommPortIdentifier.getPortIdentifier("COM3"); System.out.println("Establishing connction....."); messages[0] = "\nEstablishing connction.....\n"; } catch ( NoSuchPortException noport) { System.out.println("Port not found: "+ noport); messages[0] = "Port not found: "+ noport+"\n"; } try { serialPort = (SerialPort) portId.open("serial", 50); System.out.println("Port has been found."); messages[1] = "Port has been found.\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[1] = "" +usedport; } try { serialPort = (SerialPort) portId.open("serial", 50); messages[2] = "Connecting to COM3 on port 50....\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; } try { serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); System.out.println("Esablishing the transfer rate settings for COM3."); messages[3] = "Esablishing the transfer rate settings for COM3.\n"; } catch (UnsupportedCommOperationException nosupcom) { System.out.println(nosupcom); System.out.println("The tranfer rate could not be esblished on COM3."); messages[3] = "The tranfer rate could not be esblished on COM3.\n"; } System.out.println(serialPort.getFlowControlMode()); messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; //sendDataOut(buffer[3],buffer[4]); } I need all the data in this method (and all the string values in this method) to be printed out on a JTextArea. I wont do me any good if not all the text is printed on a JTextArea in another class. So I have the text printing the JTextArea correctly, but everytime the JButton is activated - it gives me that error message. I did add a disconnect button that is supposed to call the serialPort.close(). _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/273fd4ec/attachment-0050.html From tjarvi at qbang.org Thu Apr 24 21:54:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Apr 2008 21:54:10 -0600 (MDT) Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > Hello I am having a problem with the serial device connecting (software > wise) to the serial port. However I have a test program and it seems to > work just fine in that environment - and it doesnt use GUI. The error I > am getting is : PortNotFoundException Now the way I have it setup in the > GUI environment is that once the user pushes a JButton the program > connects using this class: > > protected void establishConnection() { > try { > portId = CommPortIdentifier.getPortIdentifier("COM3"); > System.out.println("Establishing connction....."); > messages[0] = "\nEstablishing connction.....\n"; > } > catch ( NoSuchPortException noport) { > System.out.println("Port not found: "+ noport); > messages[0] = "Port not found: "+ noport+"\n"; > } > try { > serialPort = (SerialPort) portId.open("serial", 50); > System.out.println("Port has been found."); > messages[1] = "Port has been found.\n"; > } > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[1] = "" +usedport; > } ================================================================= > try { > serialPort = (SerialPort) portId.open("serial", 50); > messages[2] = "Connecting to COM3 on port 50....\n"; > } ================================================================== > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > } > try { > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > System.out.println("Esablishing the transfer rate settings for COM3."); > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > } > catch (UnsupportedCommOperationException nosupcom) { > System.out.println(nosupcom); > System.out.println("The tranfer rate could not be esblished on COM3."); > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > } > System.out.println(serialPort.getFlowControlMode()); > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > //sendDataOut(buffer[3],buffer[4]); > } > > I need all the data in this method (and all the string values in this > method) to be printed out on a JTextArea. I wont do me any good if not > all the text is printed on a JTextArea in another class. So I have the > text printing the JTextArea correctly, but everytime the JButton is > activated - it gives me that error message. I did add a disconnect > button that is supposed to call the serialPort.close(). > The open code used twice is going to throw an exception. It may be that you catch the exception above this code and print a confusing message? A common mistake is people will accidently run two copies of their program. The first instance of the program will open the port and prevent enumeration (finding the port) in the second instance of the program. As an example, you may be running your text based application which is preventing the GUI from seeing the port. Enumeration is done by trying to open the port. If the port is open, Enumeration fails. -- Trent Jarvi tjarvi at qbang.org From fire_baptized at hotmail.com Thu Apr 24 22:32:05 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 00:32:05 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Wow - thanks dude what a dumb thing for me to not catch..... now here is the current problem - right now I am trying to output data again one is with the test program - and it seems that serialPort.setRTS(true); is throwing an exceptions there - now if I show this code please bare in mind that I am only testing - the code is kinda sloppy in my mind - but if I can figure out why calling this function is throwing an exception then maybe I can figure out why my GUI application is getting the same null pointer exceptions when try to send out the data stream. FYI Trent this email is not directed towards you - anyone can jump in on this public static void main(String args[]) { byte[] b = new byte[64]; int keyinput = 0 ; byte x = 0; byte y = 0; PortTesting1 testports = new PortTesting1(); try { joyskoro = Joystick.createInstance(); } catch (IOException ioexc) { System.out.println("There is an input/output problem: " + ioexc); } while (true) { joyskoro.poll(); b[0] = ((byte) -(10 * joyskoro.getY())); b[1] = ((byte) (10 * joyskoro.getX())); System.out.println("The 3rd byte is: " +b[0]); System.out.println("The 4rd byte is: " +b[1]); serialPort.setRTS(true); // HERE IS WHERE THE PROBLEM IS !!!!!!! ON THIS LINE but if I dont have it active in my program the Bluetooth device (that is System.out.println("Ready to send :-) !"); //connected to the serial port does not send out data!!!!! if (joyskoro.isButtonDown(joyskoro.BUTTON10)) { System.out.println("Connection terminated."); serialPort.close(); break; } if (joyskoro.isButtonDown(joyskoro.BUTTON2)) { boolean flag = true; //reading from key input from the keyboard System.out.println("Please input a command: "); while (flag) { try { keyinput = System.in.read(); } catch (IOException ioexc) {/*there is no need to put * anything here */ } if((char)keyinput=='w') { pushIt((byte)85); } if((char)keyinput=='s') { pushIt((byte)84); } if((char)keyinput=='a') { pushIt((byte)83); } if((char)keyinput=='d') { pushIt((byte)82); } if((char)keyinput=='q') { pushIt((byte)89); } if((char)keyinput=='\t') { //this stop reading input from the keyboard flag = false; } } and help anyways here is the block of code that throwing an exception for the test program: > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/5c8f7d68/attachment-0050.html From fire_baptized at hotmail.com Fri Apr 25 07:59:53 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 09:59:53 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Are there any examples of how to push out data? As in using input and output streams - if I can compare code maybe I can see where this is causing a problem. I have a byte array that I am pushing out data. I keep getting null pointer exceptions every where I turn. > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/22228ab6/attachment-0049.html From ajmas at sympatico.ca Sat Apr 26 07:37:09 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 26 Apr 2008 09:37:09 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hi, On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote: > > Are there any examples of how to push out data? As in using input > and output streams - if I can compare code maybe I can see where > this is causing a problem. I have a byte array that I am pushing > out data. I keep getting null pointer exceptions every where I turn. > There are some examples here that might be of help: http://rxtx.qbang.org/wiki/index.php/Examples Andre From fire_baptized at hotmail.com Sat Apr 26 20:13:54 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Sat, 26 Apr 2008 22:13:54 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: looked at those....yep didnt help - I need to push out data with GUI and not get a null pointer exception everytime I try. > CC: rxtx at qbang.org> From: ajmas at sympatico.ca> To: fire_baptized at hotmail.com> Subject: Re: [Rxtx] Serial Problems with Gui.....> Date: Sat, 26 Apr 2008 09:37:09 -0400> > Hi,> > > On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote:> >> > Are there any examples of how to push out data? As in using input > > and output streams - if I can compare code maybe I can see where > > this is causing a problem. I have a byte array that I am pushing > > out data. I keep getting null pointer exceptions every where I turn.> >> > There are some examples here that might be of help:> > http://rxtx.qbang.org/wiki/index.php/Examples> > Andre _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080426/09f95b41/attachment-0048.html From michael.erskine at ketech.com Mon Apr 28 02:47:22 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 28 Apr 2008 09:47:22 +0100 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D426EF3CBBC5@no-sv-03.ketech.local> Jesrael D. Summerhill wrote: > looked at those....yep didnt help - I need to push out data with GUI and > not get a null pointer exception everytime I try. So it seems pretty obvious that your code needs to check for nulls wherever one may occur and report what's happening. Alternatively, catch the npe and display the stack trace. Then you can fix your code so it doesn't try to work with something that ain't there. Regards, Michael Erskine. From scldad at sdc.com.au Mon Apr 28 03:58:34 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Mon, 28 Apr 2008 19:28:34 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Message-ID: <200804281928.34454.scldad@sdc.com.au> Has anybody done any design work on this? The first thing that springs to mind is that we still need to check for lock files because other apps tend to use that approach even if we go to ioctl. Cheers, Stephen Davies On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > Thanks Trent. > > Problem is only that I'm really not at all > Familiar with the C part of RXTX. If there > Were anything I could do in Java for this, > It would be easier for me.... > > ... Are there any C experts here on the list > Who'd like to look at ioctl port locking > For linux? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > -----Original Message----- > > From: Trent Jarvi [mailto:tjarvi at qbang.org] > > Sent: Donnerstag, 24. April 2008 04:32 > > To: Oberhuber, Martin > > Cc: rxtx at qbang.org > > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > > > I'm wondering what the status is with RXTX locking > > > serial ports on Linux? > > > > > > My understanding is that the mechanism used in > > > 2.1-7r2 (lockfiles) is not really state of the art, and > > > has lots of problems (e.g. missing permissions). > > > > > > There was an idea to migrate towards a Kernel > > > syscall based solution for port locking. > > > > > > What's the status here? > > > > Hi Martin, > > > > I'm in favor of deprecating the current FHS locking mechanism > > in favor of > > an IOCTL when available. I think it will be available on all the > > platforms but do not know for sure. > > > > The status is unchanged. I've had very few free cycles for > > such things. > > Feel free to take a stab at it if you have some time. I > > believe the IOCTL > > is used in the Mac OS X code already. > > > > I don't see any real backwards compatability issues and the > > IOCTL should > > just work. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Mon Apr 28 04:21:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 28 Apr 2008 04:21:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804281928.34454.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: I don't think there would need to be any architectural changes. A couple ifdefs and minor changes in the current code should be enough. Proposal: FHS/UUCP locks: continue to respect them, try to create them but do not error if the IOCTL is supported. (But does the IOCTL being defined mean it will work?) Enumeration: Do not assert the IOCTL while opening. Serial.open: assert the IOCTL after open. Continue to use locks as described above after asserting the IOCTL. If the IOCTL is defined but not working, handle it here. Failure cases include the IOCTL is not supported and the port is already locked. On Mon, 28 Apr 2008, Stephen Davies wrote: > Has anybody done any design work on this? > The first thing that springs to mind is that we still need to check for lock > files because other apps tend to use that approach even if we go to ioctl. > > Cheers, > Stephen Davies > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: >> Thanks Trent. >> >> Problem is only that I'm really not at all >> Familiar with the C part of RXTX. If there >> Were anything I could do in Java for this, >> It would be easier for me.... >> >> ... Are there any C experts here on the list >> Who'd like to look at ioctl port locking >> For linux? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >>> -----Original Message----- >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] >>> Sent: Donnerstag, 24. April 2008 04:32 >>> To: Oberhuber, Martin >>> Cc: rxtx at qbang.org >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? >>> >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: >>>> Dear RXTX community, >>>> >>>> I'm wondering what the status is with RXTX locking >>>> serial ports on Linux? >>>> >>>> My understanding is that the mechanism used in >>>> 2.1-7r2 (lockfiles) is not really state of the art, and >>>> has lots of problems (e.g. missing permissions). >>>> >>>> There was an idea to migrate towards a Kernel >>>> syscall based solution for port locking. >>>> >>>> What's the status here? >>> >>> Hi Martin, >>> >>> I'm in favor of deprecating the current FHS locking mechanism >>> in favor of >>> an IOCTL when available. I think it will be available on all the >>> platforms but do not know for sure. >>> >>> The status is unchanged. I've had very few free cycles for >>> such things. >>> Feel free to take a stab at it if you have some time. I >>> believe the IOCTL >>> is used in the Mac OS X code already. >>> >>> I don't see any real backwards compatability issues and the >>> IOCTL should >>> just work. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Tue Apr 29 12:04:04 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Apr 2008 20:04:04 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Hi all, The biggest problem that I have seen with lockfiles on Linux At least is, that it seems there is no standard with respect To the folder in which they should be created. Also, many Distributions seem to set up file system permissions in such A way that writing to the lockfile folder is not allowed for The normal user -- that's why we stopped using lockfiles In our commercial product. If we are to still respect lockfiles, we first need to Understand where we are expected to look for them. Does Anybody have any insight what variants of lockfile folder Schema exist out there in the wild? Some apps like minicom Seem to even allow users to manually specify a lockfile Folder of their choice. Because of the difficulty finding the right lockfile folder, And because of the inherent risk of thinking that something Might be locked while it actually isn't, I'd suggest that RXTX should have a "soft-off" feature that allows disabling ALL Lockfile checks at runtime without recompiling the native Sharedlibs. Trent - I like your strategy outline, but I think that it Needs to be configurable by the client such that users and/or Customer Support can disable lockfiles / disable ioctl in Case they detect that they are runing on an OS / Kernal that Does not support one or the other. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Montag, 28. April 2008 12:22 > To: Stephen Davies > Cc: rxtx at qbang.org; Oberhuber, Martin; Trent Jarvi > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > I don't think there would need to be any architectural > changes. A couple > ifdefs and minor changes in the current code should be enough. > > Proposal: > > FHS/UUCP locks: > continue to respect them, try to create them but do not error if > the IOCTL is supported. (But does the IOCTL being defined mean > it will work?) > Enumeration: > Do not assert the IOCTL while opening. > Serial.open: > assert the IOCTL after open. Continue to use locks as described > above after asserting the IOCTL. If the IOCTL is defined but > not working, handle it here. Failure cases include the IOCTL > is not supported and the port is already locked. > > On Mon, 28 Apr 2008, Stephen Davies wrote: > > > Has anybody done any design work on this? > > The first thing that springs to mind is that we still need > to check for lock > > files because other apps tend to use that approach even if > we go to ioctl. > > > > Cheers, > > Stephen Davies > > > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > >> Thanks Trent. > >> > >> Problem is only that I'm really not at all > >> Familiar with the C part of RXTX. If there > >> Were anything I could do in Java for this, > >> It would be easier for me.... > >> > >> ... Are there any C experts here on the list > >> Who'd like to look at ioctl port locking > >> For linux? > >> > >> Thanks, > >> -- > >> Martin Oberhuber, Senior Member of Technical Staff, Wind River > >> Target Management Project Lead, DSDP PMC Member > >> http://www.eclipse.org/dsdp/tm > >> > >>> -----Original Message----- > >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] > >>> Sent: Donnerstag, 24. April 2008 04:32 > >>> To: Oberhuber, Martin > >>> Cc: rxtx at qbang.org > >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? > >>> > >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > >>>> Dear RXTX community, > >>>> > >>>> I'm wondering what the status is with RXTX locking > >>>> serial ports on Linux? > >>>> > >>>> My understanding is that the mechanism used in > >>>> 2.1-7r2 (lockfiles) is not really state of the art, and > >>>> has lots of problems (e.g. missing permissions). > >>>> > >>>> There was an idea to migrate towards a Kernel > >>>> syscall based solution for port locking. > >>>> > >>>> What's the status here? > >>> > >>> Hi Martin, > >>> > >>> I'm in favor of deprecating the current FHS locking mechanism > >>> in favor of > >>> an IOCTL when available. I think it will be available on all the > >>> platforms but do not know for sure. > >>> > >>> The status is unchanged. I've had very few free cycles for > >>> such things. > >>> Feel free to take a stab at it if you have some time. I > >>> believe the IOCTL > >>> is used in the Mac OS X code already. > >>> > >>> I don't see any real backwards compatability issues and the > >>> IOCTL should > >>> just work. > >>> > >>> -- > >>> Trent Jarvi > >>> tjarvi at qbang.org > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > From Steffen.DETTMER at ingenico.com Tue Apr 29 13:34:44 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 29 Apr 2008 21:34:44 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Message-ID: <20080429193444.GU2928@elberon.bln.de.ingenico.com> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > The biggest problem that I have seen with lockfiles on Linux > At least is, that it seems there is no standard with respect > To the folder in which they should be created. Also, many > Distributions seem to set up file system permissions in such > A way that writing to the lockfile folder is not allowed for > The normal user -- that's why we stopped using lockfiles > In our commercial product. It seems it depends on the expectations. I consider it as a feature that by default a linux user cannot access serial ports. Maybe root connected a modem (can produce phone bills) or even some serial card reader, maybe with the web servers key pair. I would expect that by default a user cannot open the serial port because of insufficient permissions on the device file. I would expect this on other unices as well (but I don't know it). For windows I think it should be similar but not impacting so much in practice, because often windows users work with big permissions on a somewhat high priviledge level or even Administrator. > If we are to still respect lockfiles, we first need to > Understand where we are expected to look for them. Does > Anybody have any insight what variants of lockfile folder > Schema exist out there in the wild? Some apps like minicom > Seem to even allow users to manually specify a lockfile > Folder of their choice. At least my (ancient) minicom does not allow the user to change this option, it is displayed but read-only, but root is allowed to change it. > Because of the difficulty finding the right lockfile folder, > And because of the inherent risk of thinking that something > Might be locked while it actually isn't, I'd suggest that > RXTX should have a "soft-off" feature that allows disabling > ALL Lockfile checks at runtime without recompiling the native > Sharedlibs. sounds very reasonable, yes... and as admin I would not wish that users could skip such locking because they do things wrong by default ;) (in the end I guess that is related to the dilemma, that hotplug/user-owned-periphery and multi-user systems simply conflict) > Trent - I like your strategy outline, but I think that it > Needs to be configurable by the client such that users and/or > Customer Support can disable lockfiles / disable ioctl in > Case they detect that they are runing on an OS / Kernal that > Does not support one or the other. Yes, this would be good I guess... Applications could offer configuration options to control that, maybe similarily as minicom. BTW, man minicom tells: *B - Lock file location On most systems This should be /usr/spool/uucp. Linux systems use /var/lock. If this directory does not exist, minicom will not attempt to use lockfiles. The statement `Linux systems use /var/lock' is interesting, does anyone know the source of this convention? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Tue Apr 29 16:11:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Apr 2008 16:11:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? These details are outlined in the Filesystem Hierarchy Standard (FHS). http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLOCKLOCKFILES -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Tue Apr 29 18:58:09 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Wed, 30 Apr 2008 10:28:09 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: <200804301028.09307.scldad@sdc.com.au> I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is the same. Any ideas as to how to handle this? Stephen On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: > * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > > The biggest problem that I have seen with lockfiles on Linux > > At least is, that it seems there is no standard with respect > > To the folder in which they should be created. Also, many > > Distributions seem to set up file system permissions in such > > A way that writing to the lockfile folder is not allowed for > > The normal user -- that's why we stopped using lockfiles > > In our commercial product. > > It seems it depends on the expectations. I consider it as a > feature that by default a linux user cannot access serial ports. > Maybe root connected a modem (can produce phone bills) or even > some serial card reader, maybe with the web servers key pair. > > I would expect that by default a user cannot open the serial port > because of insufficient permissions on the device file. I would > expect this on other unices as well (but I don't know it). > > For windows I think it should be similar but not impacting so > much in practice, because often windows users work with big > permissions on a somewhat high priviledge level or even > Administrator. > > > If we are to still respect lockfiles, we first need to > > Understand where we are expected to look for them. Does > > Anybody have any insight what variants of lockfile folder > > Schema exist out there in the wild? Some apps like minicom > > Seem to even allow users to manually specify a lockfile > > Folder of their choice. > > At least my (ancient) minicom does not allow the user to change > this option, it is displayed but read-only, but root is allowed > to change it. > > > Because of the difficulty finding the right lockfile folder, > > And because of the inherent risk of thinking that something > > Might be locked while it actually isn't, I'd suggest that > > RXTX should have a "soft-off" feature that allows disabling > > ALL Lockfile checks at runtime without recompiling the native > > Sharedlibs. > > sounds very reasonable, yes... > and as admin I would not wish that users could skip such > locking because they do things wrong by default ;) > > (in the end I guess that is related to the dilemma, that > hotplug/user-owned-periphery and multi-user systems simply > conflict) > > > Trent - I like your strategy outline, but I think that it > > Needs to be configurable by the client such that users and/or > > Customer Support can disable lockfiles / disable ioctl in > > Case they detect that they are runing on an OS / Kernal that > > Does not support one or the other. > > Yes, this would be good I guess... Applications could offer > configuration options to control that, maybe similarily as > minicom. > > BTW, man minicom tells: > > *B - Lock file location > On most systems This should be /usr/spool/uucp. > Linux systems use /var/lock. If this directory > does not exist, minicom will not attempt to use > lockfiles. > > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure > and expedient electronic transaction acceptance. Ingenico products leverage > proven technology, established standards and unparalleled ergonomics to > provide optimal reliability, versatility and usability. This comprehensive > range of products is complemented by a global array of services and > partnerships, enabling businesses in a number of vertical sectors to accept > transactions anywhere their business takes them. www.ingenico.com This > message may contain confidential and/or privileged information. If you are > not the addressee or authorized to receive this for the addressee, you must > not use, copy, disclose or take any action based on this message or any > information herein. If you have received this message in error, please > advise the sender immediately by reply e-mail and delete this message. > Thank you for your cooperation. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Wed Apr 30 19:30:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 30 Apr 2008 19:30:51 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804301028.09307.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> <200804301028.09307.scldad@sdc.com.au> Message-ID: Hi Stephen, I suspect ioctl/TIOCEXCL open/O_EXCL would do the job. Mac uses TIOCEXCL and it is POSIX. We use O_EXCL for lockfiles on Linux already. On Wed, 30 Apr 2008, Stephen Davies wrote: > I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is > the same. > > Any ideas as to how to handle this? > > Stephen > > > On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: >> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: >>> The biggest problem that I have seen with lockfiles on Linux >>> At least is, that it seems there is no standard with respect >>> To the folder in which they should be created. Also, many >>> Distributions seem to set up file system permissions in such >>> A way that writing to the lockfile folder is not allowed for >>> The normal user -- that's why we stopped using lockfiles >>> In our commercial product. >> >> It seems it depends on the expectations. I consider it as a >> feature that by default a linux user cannot access serial ports. >> Maybe root connected a modem (can produce phone bills) or even >> some serial card reader, maybe with the web servers key pair. >> >> I would expect that by default a user cannot open the serial port >> because of insufficient permissions on the device file. I would >> expect this on other unices as well (but I don't know it). >> >> For windows I think it should be similar but not impacting so >> much in practice, because often windows users work with big >> permissions on a somewhat high priviledge level or even >> Administrator. >> >>> If we are to still respect lockfiles, we first need to >>> Understand where we are expected to look for them. Does >>> Anybody have any insight what variants of lockfile folder >>> Schema exist out there in the wild? Some apps like minicom >>> Seem to even allow users to manually specify a lockfile >>> Folder of their choice. >> >> At least my (ancient) minicom does not allow the user to change >> this option, it is displayed but read-only, but root is allowed >> to change it. >> >>> Because of the difficulty finding the right lockfile folder, >>> And because of the inherent risk of thinking that something >>> Might be locked while it actually isn't, I'd suggest that >>> RXTX should have a "soft-off" feature that allows disabling >>> ALL Lockfile checks at runtime without recompiling the native >>> Sharedlibs. >> >> sounds very reasonable, yes... >> and as admin I would not wish that users could skip such >> locking because they do things wrong by default ;) >> >> (in the end I guess that is related to the dilemma, that >> hotplug/user-owned-periphery and multi-user systems simply >> conflict) >> >>> Trent - I like your strategy outline, but I think that it >>> Needs to be configurable by the client such that users and/or >>> Customer Support can disable lockfiles / disable ioctl in >>> Case they detect that they are runing on an OS / Kernal that >>> Does not support one or the other. >> >> Yes, this would be good I guess... Applications could offer >> configuration options to control that, maybe similarily as >> minicom. >> >> BTW, man minicom tells: >> >> *B - Lock file location >> On most systems This should be /usr/spool/uucp. >> Linux systems use /var/lock. If this directory >> does not exist, minicom will not attempt to use >> lockfiles. >> >> The statement `Linux systems use /var/lock' is interesting, does >> anyone know the source of this convention? >> >> oki, >> >> Steffen >> >> About Ingenico Throughout the world businesses rely on Ingenico for secure >> and expedient electronic transaction acceptance. Ingenico products leverage >> proven technology, established standards and unparalleled ergonomics to >> provide optimal reliability, versatility and usability. This comprehensive >> range of products is complemented by a global array of services and >> partnerships, enabling businesses in a number of vertical sectors to accept >> transactions anywhere their business takes them. www.ingenico.com This >> message may contain confidential and/or privileged information. If you are >> not the addressee or authorized to receive this for the addressee, you must >> not use, copy, disclose or take any action based on this message or any >> information herein. If you have received this message in error, please >> advise the sender immediately by reply e-mail and delete this message. >> Thank you for your cooperation. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0074.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0072.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0059.html From pboulton at pulsetracer.com Fri Apr 18 14:30:13 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Fri, 18 Apr 2008 13:30:13 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site Message-ID: <480904D5.1060307@pulsetracer.com> Hello, gentle serial porters. I have downloaded the zipped up binaries for use on Windows without Sun's CommAPI, but don't seem able to extract anything from the download. Go to main page, http://www.rxtx.org/ Click on Downloads I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) And I save it to disk. If I try and extract the files with WinZip, Winzip thinks the archive is corrupt. If I try using Windows Explorer, I am able to extract it into a single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than the original .zip. Any help would be much appreciated. Sincerely, Philip Boulton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080418/97d89793/attachment-0057.html From tjarvi at qbang.org Fri Apr 18 19:07:00 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 18 Apr 2008 19:07:00 -0600 (MDT) Subject: [Rxtx] Difficulty opening zip file at rxtx site In-Reply-To: <480904D5.1060307@pulsetracer.com> References: <480904D5.1060307@pulsetracer.com> Message-ID: On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org From pboulton at pulsetracer.com Sat Apr 19 12:46:26 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Sat, 19 Apr 2008 11:46:26 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site References: <480904D5.1060307@pulsetracer.com> Message-ID: <53DB7576450695419E09299104043761A78533@ZTGSERVER.ztg.local> I have been able to get my hands on the binaries, by going to the ftp directory /pub/rxtx at ftp.qbang.org,, and ftping the file rxtx-2.1-7-bins-r2.zip . This opens happily with Winzip, and extracts as the set of files that you describe below. I only experience the ill-formed archive problem by clicking the link on the rxtx.org Downloads page (http://rxtx.qbang.org/pub/rxtx/ rxtx-2.1-7-bins-r2.zip ). Not sure what to make of that. Philip Boulton ________________________________ From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Fri 4/18/2008 6:07 PM To: Philip Boulton Cc: rxtx at qbang.org Subject: Re: [Rxtx] Difficulty opening zip file at rxtx site On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080419/147923bb/attachment-0056.html From jlar310 at gmail.com Sat Apr 19 19:11:55 2008 From: jlar310 at gmail.com (Jeff Larsen) Date: Sat, 19 Apr 2008 20:11:55 -0500 Subject: [Rxtx] Moxa serial over Ethernet driver Message-ID: Hi all, I've been using javax.comm for years to communicate with a legacy radio data system. We want to migrate the java side of the system to a VMware Server virtual machine. We've had great success using Moxa DE-303 and 5610 serial over Ethernet appliances and virtual machines for running hylafax. The OS (Linux in this case) uses a kernel driver to communicate with the Moxa via a virtual serial port such as /dev/ttyr00. I want to do the same thing with javax.comm or gnu.io to connect to a virtual serial port. However I'm hitting road blocks everywhere. javax.comm for Linux sees the virtual port, but there are transmission errors. Tried Solaris too, but the Solaris Moxa drivers don't play nice with javax.comm because the driver uses /dev/pts/n instead of /dev/term/x. Next I tried RXTX on Linux, but I'm getting NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX on Solaris. Has anyone used RXTX with serial over Ethernet devices? Any hints on how to make it work? I know that I'm not completely off track because javax.comm does work with Moxa on a Windows platform, but that's just not an option for production deployment. -- Jeff From tjarvi at qbang.org Sat Apr 19 21:08:41 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 19 Apr 2008 21:08:41 -0600 (MDT) Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: yOn Sat, 19 Apr 2008, Jeff Larsen wrote: > Hi all, > > I've been using javax.comm for years to communicate with a legacy > radio data system. We want to migrate the java side of the system to a > VMware Server virtual machine. We've had great success using Moxa > DE-303 and 5610 serial over Ethernet appliances and virtual machines > for running hylafax. The OS (Linux in this case) uses a kernel driver > to communicate with the Moxa via a virtual serial port such as > /dev/ttyr00. > > I want to do the same thing with javax.comm or gnu.io to connect to a > virtual serial port. However I'm hitting road blocks everywhere. > javax.comm for Linux sees the virtual port, but there are transmission > errors. Tried Solaris too, but the Solaris Moxa drivers don't play > nice with javax.comm because the driver uses /dev/pts/n instead of > /dev/term/x. Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris. > > Has anyone used RXTX with serial over Ethernet devices? Any hints on > how to make it work? > > I know that I'm not completely off track because javax.comm does work > with Moxa on a Windows platform, but that's just not an option for > production deployment. > > Moxa should work under linux. There may be minor issues depending upon how complete the kernel driver is but I think it will work. One of the minor issues is /dev/ttyr00 is not enumerated. There are several work arounds documented with the source code and on the wiki. The easiest solution for testing purposes is to make a symbolic link from /dev/ttyr00 to a port that is enumerated such as /dev/ttyS129. You can later alter the rxtx source or use properties to change the enumerated ports. -- Trent Jarvi tjarvi at qbang.org From d.tonhofer at m-plify.com Sun Apr 20 03:33:30 2008 From: d.tonhofer at m-plify.com (David Tonhofer (M-PLIFY S.A.)) Date: Sun, 20 Apr 2008 11:33:30 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: <480B0DEA.5010908@m-plify.com> Jeff Larsen wrote: > Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris It might be that the Java side of RXTX does not recognize that portname. Trying modifying src/RXTXCommDriver.java as described in this case: http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card From ajmas at sympatico.ca Sun Apr 20 16:37:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Apr 2008 18:37:59 -0400 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <480B0DEA.5010908@m-plify.com> References: <480B0DEA.5010908@m-plify.com> Message-ID: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > Jeff Larsen wrote: >> Next I tried RXTX on Linux, but I'm getting >> NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX >> on Solaris > It might be that the Java side of RXTX does not recognize that > portname. > Trying modifying src/RXTXCommDriver.java as described in this case: > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card I wonder whether it would be worth allowing custom port prefixes as a system parameter? For example: gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" Andre From Martin.Oberhuber at windriver.com Tue Apr 22 12:34:36 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 22 Apr 2008 20:34:36 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> References: <480B0DEA.5010908@m-plify.com> <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE6485848056CD6CE@ism-mail03.corp.ad.wrs.com> Sounds like a great idea... I'm wondering how the "variable part" after the Prefixes could be specified though? What about allowing Regular Expression character Classes in the existing System Property for specifying ports: System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyS[0-9],ttyS[ABC],ttyUSB[0-9a-z]"); The set of allowed patterns would of course need to Be restricted compared to REGEX, because it must be A syntax that supports iterating over it. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Montag, 21. April 2008 00:38 > To: rxtx at qbang.org and Users > Subject: Re: [Rxtx] Moxa serial over Ethernet driver > > > On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > > Jeff Larsen wrote: > >> Next I tried RXTX on Linux, but I'm getting > >> NoSuchPortException connecting to /dev/ttyr00. I have yet > to try RXTX > >> on Solaris > > It might be that the Java side of RXTX does not recognize that > > portname. > > Trying modifying src/RXTXCommDriver.java as described in this case: > > > > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_ > SST-4P.2FLP_multiport_card > > I wonder whether it would be worth allowing custom port > prefixes as a > system parameter? For > example: > > gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Loi.TRAN at weatherford.com Tue Apr 22 13:10:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Tue, 22 Apr 2008 14:10:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled Message-ID: Hi, I'm currently using the Java RXTX API to interface to a serial port. The serial port is connected to a bridge board that communicates with our communications system running at 1.875 Mbps which is linked to an embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no flow control). I send a command to the embedded board through the serial-bridge board which then is relayed to the embedded board. The command sent asks the embedded board to dump a binary image. Here's where I'm hitting some problems. I've successfully done this is an integrated serial port from the laptop. The binary file that comes back is consistent on every attempt. When I use the application I've written to do the same thing with a USB-to-serial adapter, the image I get back is not the same as the image I receive through the USB-to-serial adapter is not consistent at all. A final thing is that when I use a terminal program to dump the binary image with the USB-serial adapter, the image is correct. Every time! What is the terminal program doing that's not being done in my application? My application is quite simple. Has anyone observed this behavior before? If you have, I'd like to know how you've gotten around this problem. Thanks, LT =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From tjarvi at qbang.org Tue Apr 22 21:11:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 22 Apr 2008 21:11:10 -0600 (MDT) Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org From Loi.TRAN at weatherford.com Wed Apr 23 08:35:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Wed, 23 Apr 2008 09:35:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: Thanks for all the responses. I finally tried something that worked consistently. I updated my Prolific driver and repeated my tests. It worked. If you're using the Prolific type USB-serial adapters, do no use the Prolific version 2.0.2.1 driver on Windows. Update it to the latest 2.0.2.8 version. Again, thanks for all the responses. LT -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Tuesday, April 22, 2008 10:11 PM To: TRAN, Loi X. Cc: rxtx at qbang.org Subject: Re: [Rxtx] Prolific USB - RXTX data mangled On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From Martin.Oberhuber at windriver.com Wed Apr 23 18:54:26 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 02:54:26 +0200 Subject: [Rxtx] RXTX port locking on Linux status? Message-ID: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Dear RXTX community, I'm wondering what the status is with RXTX locking serial ports on Linux? My understanding is that the mechanism used in 2.1-7r2 (lockfiles) is not really state of the art, and has lots of problems (e.g. missing permissions). There was an idea to migrate towards a Kernel syscall based solution for port locking. What's the status here? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/9878db9f/attachment-0052.html From tjarvi at qbang.org Wed Apr 23 20:32:24 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Apr 2008 20:32:24 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > Dear RXTX community, > > I'm wondering what the status is with RXTX locking > serial ports on Linux? > > My understanding is that the mechanism used in > 2.1-7r2 (lockfiles) is not really state of the art, and > has lots of problems (e.g. missing permissions). > > There was an idea to migrate towards a Kernel > syscall based solution for port locking. > > What's the status here? > Hi Martin, I'm in favor of deprecating the current FHS locking mechanism in favor of an IOCTL when available. I think it will be available on all the platforms but do not know for sure. The status is unchanged. I've had very few free cycles for such things. Feel free to take a stab at it if you have some time. I believe the IOCTL is used in the Mac OS X code already. I don't see any real backwards compatability issues and the IOCTL should just work. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Apr 24 06:14:06 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 14:14:06 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Thanks Trent. Problem is only that I'm really not at all Familiar with the C part of RXTX. If there Were anything I could do in Java for this, It would be easier for me.... ... Are there any C experts here on the list Who'd like to look at ioctl port locking For linux? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Donnerstag, 24. April 2008 04:32 > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > I'm wondering what the status is with RXTX locking > > serial ports on Linux? > > > > My understanding is that the mechanism used in > > 2.1-7r2 (lockfiles) is not really state of the art, and > > has lots of problems (e.g. missing permissions). > > > > There was an idea to migrate towards a Kernel > > syscall based solution for port locking. > > > > What's the status here? > > > > Hi Martin, > > I'm in favor of deprecating the current FHS locking mechanism > in favor of > an IOCTL when available. I think it will be available on all the > platforms but do not know for sure. > > The status is unchanged. I've had very few free cycles for > such things. > Feel free to take a stab at it if you have some time. I > believe the IOCTL > is used in the Mac OS X code already. > > I don't see any real backwards compatability issues and the > IOCTL should > just work. > > -- > Trent Jarvi > tjarvi at qbang.org > From sspies at sloc.de Thu Apr 24 07:15:36 2008 From: sspies at sloc.de (Sebastian Spies) Date: Thu, 24 Apr 2008 15:15:36 +0200 (CEST) Subject: [Rxtx] rxtx on gumstix: Interrupted system call In-Reply-To: <47FB7B20.7080504@sloc.de> References: <47FB7B20.7080504@sloc.de> Message-ID: <55445.130.83.139.205.1209042936.squirrel@ssl.sloc.de> Dear list, while porting rxtx to the gumstix, I found out, that select used in readArray in SerialImp.c might not work as expected. Maybe, because of missing TIOCSERGETLSR-support? select is often interrupted, so i wrote the following quick'n'dirty hack to make it work on gumstix: diff -Nur rxtx-2.1-7r2/src/SerialImp.c rxtx-2.1-7r2/src/SerialImp.c --- rxtx-2.1-7r2/src/SerialImp.c 2006-01-29 23:19:04.000000000 +0100 +++ rxtx-2.1-7r2-patched/src/SerialImp.c 2008-04-24 14:30:17.000000000 +0200 @@ -3380,7 +3381,7 @@ JNIEXPORT jint JNICALL RXTXPort(readArray)( JNIEnv *env, jobject jobj, jbyteArray jbarray, jint offset, jint length ) { - int bytes; + int bytes = 0; jbyte *body; /* char msg[80]; */ int fd = get_java_var( env, jobj, "fd", "I" ); @@ -3397,9 +3398,18 @@ "readArray", "Invalid length" ); return -1; } - body = (*env)->GetByteArrayElements( env, jbarray, 0 ); - bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ - (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + while(1 > bytes) + { + body = (*env)->GetByteArrayElements( env, jbarray, 0 ); + bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ + (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + // quick'n'dirty - SSP + report (" trying again... \n"); + errno = 0; + } + if( bytes < 0 ) { report( "RXTXPort:readArray bytes < 0" ); LEAVE( "RXTXPort:readArray" ); > Hey, > > I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use > RXTXPort$SerialInputStream.read(), then I get the following Exception. I > did not yet figure out which system call is interrupted as strace > produces loads of output. > > Any help would be very appreciated. Thanks in advance. > Sebastian > > > [java] java.io.IOException: Interrupted system call in readArray > [java] at gnu.io.RXTXPort.readArray(Native Method) > [java] at > gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) > [java] at > java.io.FilterInputStream.read(FilterInputStream.java:189) > [java] at > java.io.BufferedInputStream.refill(BufferedInputStream.java:371) > [java] at > java.io.BufferedInputStream.read(BufferedInputStream.java:229) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) > [java] at > com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) > > -- > Sebastian Spies > > mail: sspies at sloc.de > > > > From fire_baptized at hotmail.com Thu Apr 24 18:27:48 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Thu, 24 Apr 2008 20:27:48 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hello I am having a problem with the serial device connecting (software wise) to the serial port. However I have a test program and it seems to work just fine in that environment - and it doesnt use GUI. The error I am getting is : PortNotFoundException Now the way I have it setup in the GUI environment is that once the user pushes a JButton the program connects using this class: protected void establishConnection() { try { portId = CommPortIdentifier.getPortIdentifier("COM3"); System.out.println("Establishing connction....."); messages[0] = "\nEstablishing connction.....\n"; } catch ( NoSuchPortException noport) { System.out.println("Port not found: "+ noport); messages[0] = "Port not found: "+ noport+"\n"; } try { serialPort = (SerialPort) portId.open("serial", 50); System.out.println("Port has been found."); messages[1] = "Port has been found.\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[1] = "" +usedport; } try { serialPort = (SerialPort) portId.open("serial", 50); messages[2] = "Connecting to COM3 on port 50....\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; } try { serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); System.out.println("Esablishing the transfer rate settings for COM3."); messages[3] = "Esablishing the transfer rate settings for COM3.\n"; } catch (UnsupportedCommOperationException nosupcom) { System.out.println(nosupcom); System.out.println("The tranfer rate could not be esblished on COM3."); messages[3] = "The tranfer rate could not be esblished on COM3.\n"; } System.out.println(serialPort.getFlowControlMode()); messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; //sendDataOut(buffer[3],buffer[4]); } I need all the data in this method (and all the string values in this method) to be printed out on a JTextArea. I wont do me any good if not all the text is printed on a JTextArea in another class. So I have the text printing the JTextArea correctly, but everytime the JButton is activated - it gives me that error message. I did add a disconnect button that is supposed to call the serialPort.close(). _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/273fd4ec/attachment-0051.html From tjarvi at qbang.org Thu Apr 24 21:54:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Apr 2008 21:54:10 -0600 (MDT) Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > Hello I am having a problem with the serial device connecting (software > wise) to the serial port. However I have a test program and it seems to > work just fine in that environment - and it doesnt use GUI. The error I > am getting is : PortNotFoundException Now the way I have it setup in the > GUI environment is that once the user pushes a JButton the program > connects using this class: > > protected void establishConnection() { > try { > portId = CommPortIdentifier.getPortIdentifier("COM3"); > System.out.println("Establishing connction....."); > messages[0] = "\nEstablishing connction.....\n"; > } > catch ( NoSuchPortException noport) { > System.out.println("Port not found: "+ noport); > messages[0] = "Port not found: "+ noport+"\n"; > } > try { > serialPort = (SerialPort) portId.open("serial", 50); > System.out.println("Port has been found."); > messages[1] = "Port has been found.\n"; > } > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[1] = "" +usedport; > } ================================================================= > try { > serialPort = (SerialPort) portId.open("serial", 50); > messages[2] = "Connecting to COM3 on port 50....\n"; > } ================================================================== > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > } > try { > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > System.out.println("Esablishing the transfer rate settings for COM3."); > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > } > catch (UnsupportedCommOperationException nosupcom) { > System.out.println(nosupcom); > System.out.println("The tranfer rate could not be esblished on COM3."); > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > } > System.out.println(serialPort.getFlowControlMode()); > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > //sendDataOut(buffer[3],buffer[4]); > } > > I need all the data in this method (and all the string values in this > method) to be printed out on a JTextArea. I wont do me any good if not > all the text is printed on a JTextArea in another class. So I have the > text printing the JTextArea correctly, but everytime the JButton is > activated - it gives me that error message. I did add a disconnect > button that is supposed to call the serialPort.close(). > The open code used twice is going to throw an exception. It may be that you catch the exception above this code and print a confusing message? A common mistake is people will accidently run two copies of their program. The first instance of the program will open the port and prevent enumeration (finding the port) in the second instance of the program. As an example, you may be running your text based application which is preventing the GUI from seeing the port. Enumeration is done by trying to open the port. If the port is open, Enumeration fails. -- Trent Jarvi tjarvi at qbang.org From fire_baptized at hotmail.com Thu Apr 24 22:32:05 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 00:32:05 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Wow - thanks dude what a dumb thing for me to not catch..... now here is the current problem - right now I am trying to output data again one is with the test program - and it seems that serialPort.setRTS(true); is throwing an exceptions there - now if I show this code please bare in mind that I am only testing - the code is kinda sloppy in my mind - but if I can figure out why calling this function is throwing an exception then maybe I can figure out why my GUI application is getting the same null pointer exceptions when try to send out the data stream. FYI Trent this email is not directed towards you - anyone can jump in on this public static void main(String args[]) { byte[] b = new byte[64]; int keyinput = 0 ; byte x = 0; byte y = 0; PortTesting1 testports = new PortTesting1(); try { joyskoro = Joystick.createInstance(); } catch (IOException ioexc) { System.out.println("There is an input/output problem: " + ioexc); } while (true) { joyskoro.poll(); b[0] = ((byte) -(10 * joyskoro.getY())); b[1] = ((byte) (10 * joyskoro.getX())); System.out.println("The 3rd byte is: " +b[0]); System.out.println("The 4rd byte is: " +b[1]); serialPort.setRTS(true); // HERE IS WHERE THE PROBLEM IS !!!!!!! ON THIS LINE but if I dont have it active in my program the Bluetooth device (that is System.out.println("Ready to send :-) !"); //connected to the serial port does not send out data!!!!! if (joyskoro.isButtonDown(joyskoro.BUTTON10)) { System.out.println("Connection terminated."); serialPort.close(); break; } if (joyskoro.isButtonDown(joyskoro.BUTTON2)) { boolean flag = true; //reading from key input from the keyboard System.out.println("Please input a command: "); while (flag) { try { keyinput = System.in.read(); } catch (IOException ioexc) {/*there is no need to put * anything here */ } if((char)keyinput=='w') { pushIt((byte)85); } if((char)keyinput=='s') { pushIt((byte)84); } if((char)keyinput=='a') { pushIt((byte)83); } if((char)keyinput=='d') { pushIt((byte)82); } if((char)keyinput=='q') { pushIt((byte)89); } if((char)keyinput=='\t') { //this stop reading input from the keyboard flag = false; } } and help anyways here is the block of code that throwing an exception for the test program: > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/5c8f7d68/attachment-0051.html From fire_baptized at hotmail.com Fri Apr 25 07:59:53 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 09:59:53 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Are there any examples of how to push out data? As in using input and output streams - if I can compare code maybe I can see where this is causing a problem. I have a byte array that I am pushing out data. I keep getting null pointer exceptions every where I turn. > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/22228ab6/attachment-0050.html From ajmas at sympatico.ca Sat Apr 26 07:37:09 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 26 Apr 2008 09:37:09 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hi, On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote: > > Are there any examples of how to push out data? As in using input > and output streams - if I can compare code maybe I can see where > this is causing a problem. I have a byte array that I am pushing > out data. I keep getting null pointer exceptions every where I turn. > There are some examples here that might be of help: http://rxtx.qbang.org/wiki/index.php/Examples Andre From fire_baptized at hotmail.com Sat Apr 26 20:13:54 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Sat, 26 Apr 2008 22:13:54 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: looked at those....yep didnt help - I need to push out data with GUI and not get a null pointer exception everytime I try. > CC: rxtx at qbang.org> From: ajmas at sympatico.ca> To: fire_baptized at hotmail.com> Subject: Re: [Rxtx] Serial Problems with Gui.....> Date: Sat, 26 Apr 2008 09:37:09 -0400> > Hi,> > > On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote:> >> > Are there any examples of how to push out data? As in using input > > and output streams - if I can compare code maybe I can see where > > this is causing a problem. I have a byte array that I am pushing > > out data. I keep getting null pointer exceptions every where I turn.> >> > There are some examples here that might be of help:> > http://rxtx.qbang.org/wiki/index.php/Examples> > Andre _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080426/09f95b41/attachment-0049.html From michael.erskine at ketech.com Mon Apr 28 02:47:22 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 28 Apr 2008 09:47:22 +0100 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D426EF3CBBC5@no-sv-03.ketech.local> Jesrael D. Summerhill wrote: > looked at those....yep didnt help - I need to push out data with GUI and > not get a null pointer exception everytime I try. So it seems pretty obvious that your code needs to check for nulls wherever one may occur and report what's happening. Alternatively, catch the npe and display the stack trace. Then you can fix your code so it doesn't try to work with something that ain't there. Regards, Michael Erskine. From scldad at sdc.com.au Mon Apr 28 03:58:34 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Mon, 28 Apr 2008 19:28:34 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Message-ID: <200804281928.34454.scldad@sdc.com.au> Has anybody done any design work on this? The first thing that springs to mind is that we still need to check for lock files because other apps tend to use that approach even if we go to ioctl. Cheers, Stephen Davies On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > Thanks Trent. > > Problem is only that I'm really not at all > Familiar with the C part of RXTX. If there > Were anything I could do in Java for this, > It would be easier for me.... > > ... Are there any C experts here on the list > Who'd like to look at ioctl port locking > For linux? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > -----Original Message----- > > From: Trent Jarvi [mailto:tjarvi at qbang.org] > > Sent: Donnerstag, 24. April 2008 04:32 > > To: Oberhuber, Martin > > Cc: rxtx at qbang.org > > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > > > I'm wondering what the status is with RXTX locking > > > serial ports on Linux? > > > > > > My understanding is that the mechanism used in > > > 2.1-7r2 (lockfiles) is not really state of the art, and > > > has lots of problems (e.g. missing permissions). > > > > > > There was an idea to migrate towards a Kernel > > > syscall based solution for port locking. > > > > > > What's the status here? > > > > Hi Martin, > > > > I'm in favor of deprecating the current FHS locking mechanism > > in favor of > > an IOCTL when available. I think it will be available on all the > > platforms but do not know for sure. > > > > The status is unchanged. I've had very few free cycles for > > such things. > > Feel free to take a stab at it if you have some time. I > > believe the IOCTL > > is used in the Mac OS X code already. > > > > I don't see any real backwards compatability issues and the > > IOCTL should > > just work. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Mon Apr 28 04:21:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 28 Apr 2008 04:21:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804281928.34454.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: I don't think there would need to be any architectural changes. A couple ifdefs and minor changes in the current code should be enough. Proposal: FHS/UUCP locks: continue to respect them, try to create them but do not error if the IOCTL is supported. (But does the IOCTL being defined mean it will work?) Enumeration: Do not assert the IOCTL while opening. Serial.open: assert the IOCTL after open. Continue to use locks as described above after asserting the IOCTL. If the IOCTL is defined but not working, handle it here. Failure cases include the IOCTL is not supported and the port is already locked. On Mon, 28 Apr 2008, Stephen Davies wrote: > Has anybody done any design work on this? > The first thing that springs to mind is that we still need to check for lock > files because other apps tend to use that approach even if we go to ioctl. > > Cheers, > Stephen Davies > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: >> Thanks Trent. >> >> Problem is only that I'm really not at all >> Familiar with the C part of RXTX. If there >> Were anything I could do in Java for this, >> It would be easier for me.... >> >> ... Are there any C experts here on the list >> Who'd like to look at ioctl port locking >> For linux? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >>> -----Original Message----- >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] >>> Sent: Donnerstag, 24. April 2008 04:32 >>> To: Oberhuber, Martin >>> Cc: rxtx at qbang.org >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? >>> >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: >>>> Dear RXTX community, >>>> >>>> I'm wondering what the status is with RXTX locking >>>> serial ports on Linux? >>>> >>>> My understanding is that the mechanism used in >>>> 2.1-7r2 (lockfiles) is not really state of the art, and >>>> has lots of problems (e.g. missing permissions). >>>> >>>> There was an idea to migrate towards a Kernel >>>> syscall based solution for port locking. >>>> >>>> What's the status here? >>> >>> Hi Martin, >>> >>> I'm in favor of deprecating the current FHS locking mechanism >>> in favor of >>> an IOCTL when available. I think it will be available on all the >>> platforms but do not know for sure. >>> >>> The status is unchanged. I've had very few free cycles for >>> such things. >>> Feel free to take a stab at it if you have some time. I >>> believe the IOCTL >>> is used in the Mac OS X code already. >>> >>> I don't see any real backwards compatability issues and the >>> IOCTL should >>> just work. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Tue Apr 29 12:04:04 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Apr 2008 20:04:04 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Hi all, The biggest problem that I have seen with lockfiles on Linux At least is, that it seems there is no standard with respect To the folder in which they should be created. Also, many Distributions seem to set up file system permissions in such A way that writing to the lockfile folder is not allowed for The normal user -- that's why we stopped using lockfiles In our commercial product. If we are to still respect lockfiles, we first need to Understand where we are expected to look for them. Does Anybody have any insight what variants of lockfile folder Schema exist out there in the wild? Some apps like minicom Seem to even allow users to manually specify a lockfile Folder of their choice. Because of the difficulty finding the right lockfile folder, And because of the inherent risk of thinking that something Might be locked while it actually isn't, I'd suggest that RXTX should have a "soft-off" feature that allows disabling ALL Lockfile checks at runtime without recompiling the native Sharedlibs. Trent - I like your strategy outline, but I think that it Needs to be configurable by the client such that users and/or Customer Support can disable lockfiles / disable ioctl in Case they detect that they are runing on an OS / Kernal that Does not support one or the other. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Montag, 28. April 2008 12:22 > To: Stephen Davies > Cc: rxtx at qbang.org; Oberhuber, Martin; Trent Jarvi > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > I don't think there would need to be any architectural > changes. A couple > ifdefs and minor changes in the current code should be enough. > > Proposal: > > FHS/UUCP locks: > continue to respect them, try to create them but do not error if > the IOCTL is supported. (But does the IOCTL being defined mean > it will work?) > Enumeration: > Do not assert the IOCTL while opening. > Serial.open: > assert the IOCTL after open. Continue to use locks as described > above after asserting the IOCTL. If the IOCTL is defined but > not working, handle it here. Failure cases include the IOCTL > is not supported and the port is already locked. > > On Mon, 28 Apr 2008, Stephen Davies wrote: > > > Has anybody done any design work on this? > > The first thing that springs to mind is that we still need > to check for lock > > files because other apps tend to use that approach even if > we go to ioctl. > > > > Cheers, > > Stephen Davies > > > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > >> Thanks Trent. > >> > >> Problem is only that I'm really not at all > >> Familiar with the C part of RXTX. If there > >> Were anything I could do in Java for this, > >> It would be easier for me.... > >> > >> ... Are there any C experts here on the list > >> Who'd like to look at ioctl port locking > >> For linux? > >> > >> Thanks, > >> -- > >> Martin Oberhuber, Senior Member of Technical Staff, Wind River > >> Target Management Project Lead, DSDP PMC Member > >> http://www.eclipse.org/dsdp/tm > >> > >>> -----Original Message----- > >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] > >>> Sent: Donnerstag, 24. April 2008 04:32 > >>> To: Oberhuber, Martin > >>> Cc: rxtx at qbang.org > >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? > >>> > >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > >>>> Dear RXTX community, > >>>> > >>>> I'm wondering what the status is with RXTX locking > >>>> serial ports on Linux? > >>>> > >>>> My understanding is that the mechanism used in > >>>> 2.1-7r2 (lockfiles) is not really state of the art, and > >>>> has lots of problems (e.g. missing permissions). > >>>> > >>>> There was an idea to migrate towards a Kernel > >>>> syscall based solution for port locking. > >>>> > >>>> What's the status here? > >>> > >>> Hi Martin, > >>> > >>> I'm in favor of deprecating the current FHS locking mechanism > >>> in favor of > >>> an IOCTL when available. I think it will be available on all the > >>> platforms but do not know for sure. > >>> > >>> The status is unchanged. I've had very few free cycles for > >>> such things. > >>> Feel free to take a stab at it if you have some time. I > >>> believe the IOCTL > >>> is used in the Mac OS X code already. > >>> > >>> I don't see any real backwards compatability issues and the > >>> IOCTL should > >>> just work. > >>> > >>> -- > >>> Trent Jarvi > >>> tjarvi at qbang.org > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > From Steffen.DETTMER at ingenico.com Tue Apr 29 13:34:44 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 29 Apr 2008 21:34:44 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Message-ID: <20080429193444.GU2928@elberon.bln.de.ingenico.com> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > The biggest problem that I have seen with lockfiles on Linux > At least is, that it seems there is no standard with respect > To the folder in which they should be created. Also, many > Distributions seem to set up file system permissions in such > A way that writing to the lockfile folder is not allowed for > The normal user -- that's why we stopped using lockfiles > In our commercial product. It seems it depends on the expectations. I consider it as a feature that by default a linux user cannot access serial ports. Maybe root connected a modem (can produce phone bills) or even some serial card reader, maybe with the web servers key pair. I would expect that by default a user cannot open the serial port because of insufficient permissions on the device file. I would expect this on other unices as well (but I don't know it). For windows I think it should be similar but not impacting so much in practice, because often windows users work with big permissions on a somewhat high priviledge level or even Administrator. > If we are to still respect lockfiles, we first need to > Understand where we are expected to look for them. Does > Anybody have any insight what variants of lockfile folder > Schema exist out there in the wild? Some apps like minicom > Seem to even allow users to manually specify a lockfile > Folder of their choice. At least my (ancient) minicom does not allow the user to change this option, it is displayed but read-only, but root is allowed to change it. > Because of the difficulty finding the right lockfile folder, > And because of the inherent risk of thinking that something > Might be locked while it actually isn't, I'd suggest that > RXTX should have a "soft-off" feature that allows disabling > ALL Lockfile checks at runtime without recompiling the native > Sharedlibs. sounds very reasonable, yes... and as admin I would not wish that users could skip such locking because they do things wrong by default ;) (in the end I guess that is related to the dilemma, that hotplug/user-owned-periphery and multi-user systems simply conflict) > Trent - I like your strategy outline, but I think that it > Needs to be configurable by the client such that users and/or > Customer Support can disable lockfiles / disable ioctl in > Case they detect that they are runing on an OS / Kernal that > Does not support one or the other. Yes, this would be good I guess... Applications could offer configuration options to control that, maybe similarily as minicom. BTW, man minicom tells: *B - Lock file location On most systems This should be /usr/spool/uucp. Linux systems use /var/lock. If this directory does not exist, minicom will not attempt to use lockfiles. The statement `Linux systems use /var/lock' is interesting, does anyone know the source of this convention? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Tue Apr 29 16:11:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Apr 2008 16:11:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? These details are outlined in the Filesystem Hierarchy Standard (FHS). http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLOCKLOCKFILES -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Tue Apr 29 18:58:09 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Wed, 30 Apr 2008 10:28:09 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: <200804301028.09307.scldad@sdc.com.au> I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is the same. Any ideas as to how to handle this? Stephen On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: > * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > > The biggest problem that I have seen with lockfiles on Linux > > At least is, that it seems there is no standard with respect > > To the folder in which they should be created. Also, many > > Distributions seem to set up file system permissions in such > > A way that writing to the lockfile folder is not allowed for > > The normal user -- that's why we stopped using lockfiles > > In our commercial product. > > It seems it depends on the expectations. I consider it as a > feature that by default a linux user cannot access serial ports. > Maybe root connected a modem (can produce phone bills) or even > some serial card reader, maybe with the web servers key pair. > > I would expect that by default a user cannot open the serial port > because of insufficient permissions on the device file. I would > expect this on other unices as well (but I don't know it). > > For windows I think it should be similar but not impacting so > much in practice, because often windows users work with big > permissions on a somewhat high priviledge level or even > Administrator. > > > If we are to still respect lockfiles, we first need to > > Understand where we are expected to look for them. Does > > Anybody have any insight what variants of lockfile folder > > Schema exist out there in the wild? Some apps like minicom > > Seem to even allow users to manually specify a lockfile > > Folder of their choice. > > At least my (ancient) minicom does not allow the user to change > this option, it is displayed but read-only, but root is allowed > to change it. > > > Because of the difficulty finding the right lockfile folder, > > And because of the inherent risk of thinking that something > > Might be locked while it actually isn't, I'd suggest that > > RXTX should have a "soft-off" feature that allows disabling > > ALL Lockfile checks at runtime without recompiling the native > > Sharedlibs. > > sounds very reasonable, yes... > and as admin I would not wish that users could skip such > locking because they do things wrong by default ;) > > (in the end I guess that is related to the dilemma, that > hotplug/user-owned-periphery and multi-user systems simply > conflict) > > > Trent - I like your strategy outline, but I think that it > > Needs to be configurable by the client such that users and/or > > Customer Support can disable lockfiles / disable ioctl in > > Case they detect that they are runing on an OS / Kernal that > > Does not support one or the other. > > Yes, this would be good I guess... Applications could offer > configuration options to control that, maybe similarily as > minicom. > > BTW, man minicom tells: > > *B - Lock file location > On most systems This should be /usr/spool/uucp. > Linux systems use /var/lock. If this directory > does not exist, minicom will not attempt to use > lockfiles. > > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure > and expedient electronic transaction acceptance. Ingenico products leverage > proven technology, established standards and unparalleled ergonomics to > provide optimal reliability, versatility and usability. This comprehensive > range of products is complemented by a global array of services and > partnerships, enabling businesses in a number of vertical sectors to accept > transactions anywhere their business takes them. www.ingenico.com This > message may contain confidential and/or privileged information. If you are > not the addressee or authorized to receive this for the addressee, you must > not use, copy, disclose or take any action based on this message or any > information herein. If you have received this message in error, please > advise the sender immediately by reply e-mail and delete this message. > Thank you for your cooperation. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Wed Apr 30 19:30:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 30 Apr 2008 19:30:51 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804301028.09307.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> <200804301028.09307.scldad@sdc.com.au> Message-ID: Hi Stephen, I suspect ioctl/TIOCEXCL open/O_EXCL would do the job. Mac uses TIOCEXCL and it is POSIX. We use O_EXCL for lockfiles on Linux already. On Wed, 30 Apr 2008, Stephen Davies wrote: > I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is > the same. > > Any ideas as to how to handle this? > > Stephen > > > On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: >> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: >>> The biggest problem that I have seen with lockfiles on Linux >>> At least is, that it seems there is no standard with respect >>> To the folder in which they should be created. Also, many >>> Distributions seem to set up file system permissions in such >>> A way that writing to the lockfile folder is not allowed for >>> The normal user -- that's why we stopped using lockfiles >>> In our commercial product. >> >> It seems it depends on the expectations. I consider it as a >> feature that by default a linux user cannot access serial ports. >> Maybe root connected a modem (can produce phone bills) or even >> some serial card reader, maybe with the web servers key pair. >> >> I would expect that by default a user cannot open the serial port >> because of insufficient permissions on the device file. I would >> expect this on other unices as well (but I don't know it). >> >> For windows I think it should be similar but not impacting so >> much in practice, because often windows users work with big >> permissions on a somewhat high priviledge level or even >> Administrator. >> >>> If we are to still respect lockfiles, we first need to >>> Understand where we are expected to look for them. Does >>> Anybody have any insight what variants of lockfile folder >>> Schema exist out there in the wild? Some apps like minicom >>> Seem to even allow users to manually specify a lockfile >>> Folder of their choice. >> >> At least my (ancient) minicom does not allow the user to change >> this option, it is displayed but read-only, but root is allowed >> to change it. >> >>> Because of the difficulty finding the right lockfile folder, >>> And because of the inherent risk of thinking that something >>> Might be locked while it actually isn't, I'd suggest that >>> RXTX should have a "soft-off" feature that allows disabling >>> ALL Lockfile checks at runtime without recompiling the native >>> Sharedlibs. >> >> sounds very reasonable, yes... >> and as admin I would not wish that users could skip such >> locking because they do things wrong by default ;) >> >> (in the end I guess that is related to the dilemma, that >> hotplug/user-owned-periphery and multi-user systems simply >> conflict) >> >>> Trent - I like your strategy outline, but I think that it >>> Needs to be configurable by the client such that users and/or >>> Customer Support can disable lockfiles / disable ioctl in >>> Case they detect that they are runing on an OS / Kernal that >>> Does not support one or the other. >> >> Yes, this would be good I guess... Applications could offer >> configuration options to control that, maybe similarily as >> minicom. >> >> BTW, man minicom tells: >> >> *B - Lock file location >> On most systems This should be /usr/spool/uucp. >> Linux systems use /var/lock. If this directory >> does not exist, minicom will not attempt to use >> lockfiles. >> >> The statement `Linux systems use /var/lock' is interesting, does >> anyone know the source of this convention? >> >> oki, >> >> Steffen >> >> About Ingenico Throughout the world businesses rely on Ingenico for secure >> and expedient electronic transaction acceptance. Ingenico products leverage >> proven technology, established standards and unparalleled ergonomics to >> provide optimal reliability, versatility and usability. This comprehensive >> range of products is complemented by a global array of services and >> partnerships, enabling businesses in a number of vertical sectors to accept >> transactions anywhere their business takes them. www.ingenico.com This >> message may contain confidential and/or privileged information. If you are >> not the addressee or authorized to receive this for the addressee, you must >> not use, copy, disclose or take any action based on this message or any >> information herein. If you have received this message in error, please >> advise the sender immediately by reply e-mail and delete this message. >> Thank you for your cooperation. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0075.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0073.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0060.html From pboulton at pulsetracer.com Fri Apr 18 14:30:13 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Fri, 18 Apr 2008 13:30:13 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site Message-ID: <480904D5.1060307@pulsetracer.com> Hello, gentle serial porters. I have downloaded the zipped up binaries for use on Windows without Sun's CommAPI, but don't seem able to extract anything from the download. Go to main page, http://www.rxtx.org/ Click on Downloads I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) And I save it to disk. If I try and extract the files with WinZip, Winzip thinks the archive is corrupt. If I try using Windows Explorer, I am able to extract it into a single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than the original .zip. Any help would be much appreciated. Sincerely, Philip Boulton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080418/97d89793/attachment-0058.html From tjarvi at qbang.org Fri Apr 18 19:07:00 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 18 Apr 2008 19:07:00 -0600 (MDT) Subject: [Rxtx] Difficulty opening zip file at rxtx site In-Reply-To: <480904D5.1060307@pulsetracer.com> References: <480904D5.1060307@pulsetracer.com> Message-ID: On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org From pboulton at pulsetracer.com Sat Apr 19 12:46:26 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Sat, 19 Apr 2008 11:46:26 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site References: <480904D5.1060307@pulsetracer.com> Message-ID: <53DB7576450695419E09299104043761A78533@ZTGSERVER.ztg.local> I have been able to get my hands on the binaries, by going to the ftp directory /pub/rxtx at ftp.qbang.org,, and ftping the file rxtx-2.1-7-bins-r2.zip . This opens happily with Winzip, and extracts as the set of files that you describe below. I only experience the ill-formed archive problem by clicking the link on the rxtx.org Downloads page (http://rxtx.qbang.org/pub/rxtx/ rxtx-2.1-7-bins-r2.zip ). Not sure what to make of that. Philip Boulton ________________________________ From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Fri 4/18/2008 6:07 PM To: Philip Boulton Cc: rxtx at qbang.org Subject: Re: [Rxtx] Difficulty opening zip file at rxtx site On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080419/147923bb/attachment-0057.html From jlar310 at gmail.com Sat Apr 19 19:11:55 2008 From: jlar310 at gmail.com (Jeff Larsen) Date: Sat, 19 Apr 2008 20:11:55 -0500 Subject: [Rxtx] Moxa serial over Ethernet driver Message-ID: Hi all, I've been using javax.comm for years to communicate with a legacy radio data system. We want to migrate the java side of the system to a VMware Server virtual machine. We've had great success using Moxa DE-303 and 5610 serial over Ethernet appliances and virtual machines for running hylafax. The OS (Linux in this case) uses a kernel driver to communicate with the Moxa via a virtual serial port such as /dev/ttyr00. I want to do the same thing with javax.comm or gnu.io to connect to a virtual serial port. However I'm hitting road blocks everywhere. javax.comm for Linux sees the virtual port, but there are transmission errors. Tried Solaris too, but the Solaris Moxa drivers don't play nice with javax.comm because the driver uses /dev/pts/n instead of /dev/term/x. Next I tried RXTX on Linux, but I'm getting NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX on Solaris. Has anyone used RXTX with serial over Ethernet devices? Any hints on how to make it work? I know that I'm not completely off track because javax.comm does work with Moxa on a Windows platform, but that's just not an option for production deployment. -- Jeff From tjarvi at qbang.org Sat Apr 19 21:08:41 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 19 Apr 2008 21:08:41 -0600 (MDT) Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: yOn Sat, 19 Apr 2008, Jeff Larsen wrote: > Hi all, > > I've been using javax.comm for years to communicate with a legacy > radio data system. We want to migrate the java side of the system to a > VMware Server virtual machine. We've had great success using Moxa > DE-303 and 5610 serial over Ethernet appliances and virtual machines > for running hylafax. The OS (Linux in this case) uses a kernel driver > to communicate with the Moxa via a virtual serial port such as > /dev/ttyr00. > > I want to do the same thing with javax.comm or gnu.io to connect to a > virtual serial port. However I'm hitting road blocks everywhere. > javax.comm for Linux sees the virtual port, but there are transmission > errors. Tried Solaris too, but the Solaris Moxa drivers don't play > nice with javax.comm because the driver uses /dev/pts/n instead of > /dev/term/x. Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris. > > Has anyone used RXTX with serial over Ethernet devices? Any hints on > how to make it work? > > I know that I'm not completely off track because javax.comm does work > with Moxa on a Windows platform, but that's just not an option for > production deployment. > > Moxa should work under linux. There may be minor issues depending upon how complete the kernel driver is but I think it will work. One of the minor issues is /dev/ttyr00 is not enumerated. There are several work arounds documented with the source code and on the wiki. The easiest solution for testing purposes is to make a symbolic link from /dev/ttyr00 to a port that is enumerated such as /dev/ttyS129. You can later alter the rxtx source or use properties to change the enumerated ports. -- Trent Jarvi tjarvi at qbang.org From d.tonhofer at m-plify.com Sun Apr 20 03:33:30 2008 From: d.tonhofer at m-plify.com (David Tonhofer (M-PLIFY S.A.)) Date: Sun, 20 Apr 2008 11:33:30 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: <480B0DEA.5010908@m-plify.com> Jeff Larsen wrote: > Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris It might be that the Java side of RXTX does not recognize that portname. Trying modifying src/RXTXCommDriver.java as described in this case: http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card From ajmas at sympatico.ca Sun Apr 20 16:37:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Apr 2008 18:37:59 -0400 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <480B0DEA.5010908@m-plify.com> References: <480B0DEA.5010908@m-plify.com> Message-ID: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > Jeff Larsen wrote: >> Next I tried RXTX on Linux, but I'm getting >> NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX >> on Solaris > It might be that the Java side of RXTX does not recognize that > portname. > Trying modifying src/RXTXCommDriver.java as described in this case: > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card I wonder whether it would be worth allowing custom port prefixes as a system parameter? For example: gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" Andre From Martin.Oberhuber at windriver.com Tue Apr 22 12:34:36 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 22 Apr 2008 20:34:36 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> References: <480B0DEA.5010908@m-plify.com> <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE6485848056CD6CE@ism-mail03.corp.ad.wrs.com> Sounds like a great idea... I'm wondering how the "variable part" after the Prefixes could be specified though? What about allowing Regular Expression character Classes in the existing System Property for specifying ports: System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyS[0-9],ttyS[ABC],ttyUSB[0-9a-z]"); The set of allowed patterns would of course need to Be restricted compared to REGEX, because it must be A syntax that supports iterating over it. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Montag, 21. April 2008 00:38 > To: rxtx at qbang.org and Users > Subject: Re: [Rxtx] Moxa serial over Ethernet driver > > > On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > > Jeff Larsen wrote: > >> Next I tried RXTX on Linux, but I'm getting > >> NoSuchPortException connecting to /dev/ttyr00. I have yet > to try RXTX > >> on Solaris > > It might be that the Java side of RXTX does not recognize that > > portname. > > Trying modifying src/RXTXCommDriver.java as described in this case: > > > > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_ > SST-4P.2FLP_multiport_card > > I wonder whether it would be worth allowing custom port > prefixes as a > system parameter? For > example: > > gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Loi.TRAN at weatherford.com Tue Apr 22 13:10:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Tue, 22 Apr 2008 14:10:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled Message-ID: Hi, I'm currently using the Java RXTX API to interface to a serial port. The serial port is connected to a bridge board that communicates with our communications system running at 1.875 Mbps which is linked to an embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no flow control). I send a command to the embedded board through the serial-bridge board which then is relayed to the embedded board. The command sent asks the embedded board to dump a binary image. Here's where I'm hitting some problems. I've successfully done this is an integrated serial port from the laptop. The binary file that comes back is consistent on every attempt. When I use the application I've written to do the same thing with a USB-to-serial adapter, the image I get back is not the same as the image I receive through the USB-to-serial adapter is not consistent at all. A final thing is that when I use a terminal program to dump the binary image with the USB-serial adapter, the image is correct. Every time! What is the terminal program doing that's not being done in my application? My application is quite simple. Has anyone observed this behavior before? If you have, I'd like to know how you've gotten around this problem. Thanks, LT =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From tjarvi at qbang.org Tue Apr 22 21:11:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 22 Apr 2008 21:11:10 -0600 (MDT) Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org From Loi.TRAN at weatherford.com Wed Apr 23 08:35:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Wed, 23 Apr 2008 09:35:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: Thanks for all the responses. I finally tried something that worked consistently. I updated my Prolific driver and repeated my tests. It worked. If you're using the Prolific type USB-serial adapters, do no use the Prolific version 2.0.2.1 driver on Windows. Update it to the latest 2.0.2.8 version. Again, thanks for all the responses. LT -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Tuesday, April 22, 2008 10:11 PM To: TRAN, Loi X. Cc: rxtx at qbang.org Subject: Re: [Rxtx] Prolific USB - RXTX data mangled On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From Martin.Oberhuber at windriver.com Wed Apr 23 18:54:26 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 02:54:26 +0200 Subject: [Rxtx] RXTX port locking on Linux status? Message-ID: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Dear RXTX community, I'm wondering what the status is with RXTX locking serial ports on Linux? My understanding is that the mechanism used in 2.1-7r2 (lockfiles) is not really state of the art, and has lots of problems (e.g. missing permissions). There was an idea to migrate towards a Kernel syscall based solution for port locking. What's the status here? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/9878db9f/attachment-0053.html From tjarvi at qbang.org Wed Apr 23 20:32:24 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Apr 2008 20:32:24 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > Dear RXTX community, > > I'm wondering what the status is with RXTX locking > serial ports on Linux? > > My understanding is that the mechanism used in > 2.1-7r2 (lockfiles) is not really state of the art, and > has lots of problems (e.g. missing permissions). > > There was an idea to migrate towards a Kernel > syscall based solution for port locking. > > What's the status here? > Hi Martin, I'm in favor of deprecating the current FHS locking mechanism in favor of an IOCTL when available. I think it will be available on all the platforms but do not know for sure. The status is unchanged. I've had very few free cycles for such things. Feel free to take a stab at it if you have some time. I believe the IOCTL is used in the Mac OS X code already. I don't see any real backwards compatability issues and the IOCTL should just work. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Apr 24 06:14:06 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 14:14:06 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Thanks Trent. Problem is only that I'm really not at all Familiar with the C part of RXTX. If there Were anything I could do in Java for this, It would be easier for me.... ... Are there any C experts here on the list Who'd like to look at ioctl port locking For linux? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Donnerstag, 24. April 2008 04:32 > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > I'm wondering what the status is with RXTX locking > > serial ports on Linux? > > > > My understanding is that the mechanism used in > > 2.1-7r2 (lockfiles) is not really state of the art, and > > has lots of problems (e.g. missing permissions). > > > > There was an idea to migrate towards a Kernel > > syscall based solution for port locking. > > > > What's the status here? > > > > Hi Martin, > > I'm in favor of deprecating the current FHS locking mechanism > in favor of > an IOCTL when available. I think it will be available on all the > platforms but do not know for sure. > > The status is unchanged. I've had very few free cycles for > such things. > Feel free to take a stab at it if you have some time. I > believe the IOCTL > is used in the Mac OS X code already. > > I don't see any real backwards compatability issues and the > IOCTL should > just work. > > -- > Trent Jarvi > tjarvi at qbang.org > From sspies at sloc.de Thu Apr 24 07:15:36 2008 From: sspies at sloc.de (Sebastian Spies) Date: Thu, 24 Apr 2008 15:15:36 +0200 (CEST) Subject: [Rxtx] rxtx on gumstix: Interrupted system call In-Reply-To: <47FB7B20.7080504@sloc.de> References: <47FB7B20.7080504@sloc.de> Message-ID: <55445.130.83.139.205.1209042936.squirrel@ssl.sloc.de> Dear list, while porting rxtx to the gumstix, I found out, that select used in readArray in SerialImp.c might not work as expected. Maybe, because of missing TIOCSERGETLSR-support? select is often interrupted, so i wrote the following quick'n'dirty hack to make it work on gumstix: diff -Nur rxtx-2.1-7r2/src/SerialImp.c rxtx-2.1-7r2/src/SerialImp.c --- rxtx-2.1-7r2/src/SerialImp.c 2006-01-29 23:19:04.000000000 +0100 +++ rxtx-2.1-7r2-patched/src/SerialImp.c 2008-04-24 14:30:17.000000000 +0200 @@ -3380,7 +3381,7 @@ JNIEXPORT jint JNICALL RXTXPort(readArray)( JNIEnv *env, jobject jobj, jbyteArray jbarray, jint offset, jint length ) { - int bytes; + int bytes = 0; jbyte *body; /* char msg[80]; */ int fd = get_java_var( env, jobj, "fd", "I" ); @@ -3397,9 +3398,18 @@ "readArray", "Invalid length" ); return -1; } - body = (*env)->GetByteArrayElements( env, jbarray, 0 ); - bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ - (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + while(1 > bytes) + { + body = (*env)->GetByteArrayElements( env, jbarray, 0 ); + bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ + (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + // quick'n'dirty - SSP + report (" trying again... \n"); + errno = 0; + } + if( bytes < 0 ) { report( "RXTXPort:readArray bytes < 0" ); LEAVE( "RXTXPort:readArray" ); > Hey, > > I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use > RXTXPort$SerialInputStream.read(), then I get the following Exception. I > did not yet figure out which system call is interrupted as strace > produces loads of output. > > Any help would be very appreciated. Thanks in advance. > Sebastian > > > [java] java.io.IOException: Interrupted system call in readArray > [java] at gnu.io.RXTXPort.readArray(Native Method) > [java] at > gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) > [java] at > java.io.FilterInputStream.read(FilterInputStream.java:189) > [java] at > java.io.BufferedInputStream.refill(BufferedInputStream.java:371) > [java] at > java.io.BufferedInputStream.read(BufferedInputStream.java:229) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) > [java] at > com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) > > -- > Sebastian Spies > > mail: sspies at sloc.de > > > > From fire_baptized at hotmail.com Thu Apr 24 18:27:48 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Thu, 24 Apr 2008 20:27:48 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hello I am having a problem with the serial device connecting (software wise) to the serial port. However I have a test program and it seems to work just fine in that environment - and it doesnt use GUI. The error I am getting is : PortNotFoundException Now the way I have it setup in the GUI environment is that once the user pushes a JButton the program connects using this class: protected void establishConnection() { try { portId = CommPortIdentifier.getPortIdentifier("COM3"); System.out.println("Establishing connction....."); messages[0] = "\nEstablishing connction.....\n"; } catch ( NoSuchPortException noport) { System.out.println("Port not found: "+ noport); messages[0] = "Port not found: "+ noport+"\n"; } try { serialPort = (SerialPort) portId.open("serial", 50); System.out.println("Port has been found."); messages[1] = "Port has been found.\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[1] = "" +usedport; } try { serialPort = (SerialPort) portId.open("serial", 50); messages[2] = "Connecting to COM3 on port 50....\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; } try { serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); System.out.println("Esablishing the transfer rate settings for COM3."); messages[3] = "Esablishing the transfer rate settings for COM3.\n"; } catch (UnsupportedCommOperationException nosupcom) { System.out.println(nosupcom); System.out.println("The tranfer rate could not be esblished on COM3."); messages[3] = "The tranfer rate could not be esblished on COM3.\n"; } System.out.println(serialPort.getFlowControlMode()); messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; //sendDataOut(buffer[3],buffer[4]); } I need all the data in this method (and all the string values in this method) to be printed out on a JTextArea. I wont do me any good if not all the text is printed on a JTextArea in another class. So I have the text printing the JTextArea correctly, but everytime the JButton is activated - it gives me that error message. I did add a disconnect button that is supposed to call the serialPort.close(). _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/273fd4ec/attachment-0052.html From tjarvi at qbang.org Thu Apr 24 21:54:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Apr 2008 21:54:10 -0600 (MDT) Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > Hello I am having a problem with the serial device connecting (software > wise) to the serial port. However I have a test program and it seems to > work just fine in that environment - and it doesnt use GUI. The error I > am getting is : PortNotFoundException Now the way I have it setup in the > GUI environment is that once the user pushes a JButton the program > connects using this class: > > protected void establishConnection() { > try { > portId = CommPortIdentifier.getPortIdentifier("COM3"); > System.out.println("Establishing connction....."); > messages[0] = "\nEstablishing connction.....\n"; > } > catch ( NoSuchPortException noport) { > System.out.println("Port not found: "+ noport); > messages[0] = "Port not found: "+ noport+"\n"; > } > try { > serialPort = (SerialPort) portId.open("serial", 50); > System.out.println("Port has been found."); > messages[1] = "Port has been found.\n"; > } > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[1] = "" +usedport; > } ================================================================= > try { > serialPort = (SerialPort) portId.open("serial", 50); > messages[2] = "Connecting to COM3 on port 50....\n"; > } ================================================================== > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > } > try { > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > System.out.println("Esablishing the transfer rate settings for COM3."); > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > } > catch (UnsupportedCommOperationException nosupcom) { > System.out.println(nosupcom); > System.out.println("The tranfer rate could not be esblished on COM3."); > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > } > System.out.println(serialPort.getFlowControlMode()); > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > //sendDataOut(buffer[3],buffer[4]); > } > > I need all the data in this method (and all the string values in this > method) to be printed out on a JTextArea. I wont do me any good if not > all the text is printed on a JTextArea in another class. So I have the > text printing the JTextArea correctly, but everytime the JButton is > activated - it gives me that error message. I did add a disconnect > button that is supposed to call the serialPort.close(). > The open code used twice is going to throw an exception. It may be that you catch the exception above this code and print a confusing message? A common mistake is people will accidently run two copies of their program. The first instance of the program will open the port and prevent enumeration (finding the port) in the second instance of the program. As an example, you may be running your text based application which is preventing the GUI from seeing the port. Enumeration is done by trying to open the port. If the port is open, Enumeration fails. -- Trent Jarvi tjarvi at qbang.org From fire_baptized at hotmail.com Thu Apr 24 22:32:05 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 00:32:05 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Wow - thanks dude what a dumb thing for me to not catch..... now here is the current problem - right now I am trying to output data again one is with the test program - and it seems that serialPort.setRTS(true); is throwing an exceptions there - now if I show this code please bare in mind that I am only testing - the code is kinda sloppy in my mind - but if I can figure out why calling this function is throwing an exception then maybe I can figure out why my GUI application is getting the same null pointer exceptions when try to send out the data stream. FYI Trent this email is not directed towards you - anyone can jump in on this public static void main(String args[]) { byte[] b = new byte[64]; int keyinput = 0 ; byte x = 0; byte y = 0; PortTesting1 testports = new PortTesting1(); try { joyskoro = Joystick.createInstance(); } catch (IOException ioexc) { System.out.println("There is an input/output problem: " + ioexc); } while (true) { joyskoro.poll(); b[0] = ((byte) -(10 * joyskoro.getY())); b[1] = ((byte) (10 * joyskoro.getX())); System.out.println("The 3rd byte is: " +b[0]); System.out.println("The 4rd byte is: " +b[1]); serialPort.setRTS(true); // HERE IS WHERE THE PROBLEM IS !!!!!!! ON THIS LINE but if I dont have it active in my program the Bluetooth device (that is System.out.println("Ready to send :-) !"); //connected to the serial port does not send out data!!!!! if (joyskoro.isButtonDown(joyskoro.BUTTON10)) { System.out.println("Connection terminated."); serialPort.close(); break; } if (joyskoro.isButtonDown(joyskoro.BUTTON2)) { boolean flag = true; //reading from key input from the keyboard System.out.println("Please input a command: "); while (flag) { try { keyinput = System.in.read(); } catch (IOException ioexc) {/*there is no need to put * anything here */ } if((char)keyinput=='w') { pushIt((byte)85); } if((char)keyinput=='s') { pushIt((byte)84); } if((char)keyinput=='a') { pushIt((byte)83); } if((char)keyinput=='d') { pushIt((byte)82); } if((char)keyinput=='q') { pushIt((byte)89); } if((char)keyinput=='\t') { //this stop reading input from the keyboard flag = false; } } and help anyways here is the block of code that throwing an exception for the test program: > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/5c8f7d68/attachment-0052.html From fire_baptized at hotmail.com Fri Apr 25 07:59:53 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 09:59:53 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Are there any examples of how to push out data? As in using input and output streams - if I can compare code maybe I can see where this is causing a problem. I have a byte array that I am pushing out data. I keep getting null pointer exceptions every where I turn. > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/22228ab6/attachment-0051.html From ajmas at sympatico.ca Sat Apr 26 07:37:09 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 26 Apr 2008 09:37:09 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hi, On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote: > > Are there any examples of how to push out data? As in using input > and output streams - if I can compare code maybe I can see where > this is causing a problem. I have a byte array that I am pushing > out data. I keep getting null pointer exceptions every where I turn. > There are some examples here that might be of help: http://rxtx.qbang.org/wiki/index.php/Examples Andre From fire_baptized at hotmail.com Sat Apr 26 20:13:54 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Sat, 26 Apr 2008 22:13:54 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: looked at those....yep didnt help - I need to push out data with GUI and not get a null pointer exception everytime I try. > CC: rxtx at qbang.org> From: ajmas at sympatico.ca> To: fire_baptized at hotmail.com> Subject: Re: [Rxtx] Serial Problems with Gui.....> Date: Sat, 26 Apr 2008 09:37:09 -0400> > Hi,> > > On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote:> >> > Are there any examples of how to push out data? As in using input > > and output streams - if I can compare code maybe I can see where > > this is causing a problem. I have a byte array that I am pushing > > out data. I keep getting null pointer exceptions every where I turn.> >> > There are some examples here that might be of help:> > http://rxtx.qbang.org/wiki/index.php/Examples> > Andre _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080426/09f95b41/attachment-0050.html From michael.erskine at ketech.com Mon Apr 28 02:47:22 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 28 Apr 2008 09:47:22 +0100 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D426EF3CBBC5@no-sv-03.ketech.local> Jesrael D. Summerhill wrote: > looked at those....yep didnt help - I need to push out data with GUI and > not get a null pointer exception everytime I try. So it seems pretty obvious that your code needs to check for nulls wherever one may occur and report what's happening. Alternatively, catch the npe and display the stack trace. Then you can fix your code so it doesn't try to work with something that ain't there. Regards, Michael Erskine. From scldad at sdc.com.au Mon Apr 28 03:58:34 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Mon, 28 Apr 2008 19:28:34 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Message-ID: <200804281928.34454.scldad@sdc.com.au> Has anybody done any design work on this? The first thing that springs to mind is that we still need to check for lock files because other apps tend to use that approach even if we go to ioctl. Cheers, Stephen Davies On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > Thanks Trent. > > Problem is only that I'm really not at all > Familiar with the C part of RXTX. If there > Were anything I could do in Java for this, > It would be easier for me.... > > ... Are there any C experts here on the list > Who'd like to look at ioctl port locking > For linux? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > -----Original Message----- > > From: Trent Jarvi [mailto:tjarvi at qbang.org] > > Sent: Donnerstag, 24. April 2008 04:32 > > To: Oberhuber, Martin > > Cc: rxtx at qbang.org > > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > > > I'm wondering what the status is with RXTX locking > > > serial ports on Linux? > > > > > > My understanding is that the mechanism used in > > > 2.1-7r2 (lockfiles) is not really state of the art, and > > > has lots of problems (e.g. missing permissions). > > > > > > There was an idea to migrate towards a Kernel > > > syscall based solution for port locking. > > > > > > What's the status here? > > > > Hi Martin, > > > > I'm in favor of deprecating the current FHS locking mechanism > > in favor of > > an IOCTL when available. I think it will be available on all the > > platforms but do not know for sure. > > > > The status is unchanged. I've had very few free cycles for > > such things. > > Feel free to take a stab at it if you have some time. I > > believe the IOCTL > > is used in the Mac OS X code already. > > > > I don't see any real backwards compatability issues and the > > IOCTL should > > just work. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Mon Apr 28 04:21:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 28 Apr 2008 04:21:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804281928.34454.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: I don't think there would need to be any architectural changes. A couple ifdefs and minor changes in the current code should be enough. Proposal: FHS/UUCP locks: continue to respect them, try to create them but do not error if the IOCTL is supported. (But does the IOCTL being defined mean it will work?) Enumeration: Do not assert the IOCTL while opening. Serial.open: assert the IOCTL after open. Continue to use locks as described above after asserting the IOCTL. If the IOCTL is defined but not working, handle it here. Failure cases include the IOCTL is not supported and the port is already locked. On Mon, 28 Apr 2008, Stephen Davies wrote: > Has anybody done any design work on this? > The first thing that springs to mind is that we still need to check for lock > files because other apps tend to use that approach even if we go to ioctl. > > Cheers, > Stephen Davies > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: >> Thanks Trent. >> >> Problem is only that I'm really not at all >> Familiar with the C part of RXTX. If there >> Were anything I could do in Java for this, >> It would be easier for me.... >> >> ... Are there any C experts here on the list >> Who'd like to look at ioctl port locking >> For linux? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >>> -----Original Message----- >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] >>> Sent: Donnerstag, 24. April 2008 04:32 >>> To: Oberhuber, Martin >>> Cc: rxtx at qbang.org >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? >>> >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: >>>> Dear RXTX community, >>>> >>>> I'm wondering what the status is with RXTX locking >>>> serial ports on Linux? >>>> >>>> My understanding is that the mechanism used in >>>> 2.1-7r2 (lockfiles) is not really state of the art, and >>>> has lots of problems (e.g. missing permissions). >>>> >>>> There was an idea to migrate towards a Kernel >>>> syscall based solution for port locking. >>>> >>>> What's the status here? >>> >>> Hi Martin, >>> >>> I'm in favor of deprecating the current FHS locking mechanism >>> in favor of >>> an IOCTL when available. I think it will be available on all the >>> platforms but do not know for sure. >>> >>> The status is unchanged. I've had very few free cycles for >>> such things. >>> Feel free to take a stab at it if you have some time. I >>> believe the IOCTL >>> is used in the Mac OS X code already. >>> >>> I don't see any real backwards compatability issues and the >>> IOCTL should >>> just work. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Tue Apr 29 12:04:04 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Apr 2008 20:04:04 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Hi all, The biggest problem that I have seen with lockfiles on Linux At least is, that it seems there is no standard with respect To the folder in which they should be created. Also, many Distributions seem to set up file system permissions in such A way that writing to the lockfile folder is not allowed for The normal user -- that's why we stopped using lockfiles In our commercial product. If we are to still respect lockfiles, we first need to Understand where we are expected to look for them. Does Anybody have any insight what variants of lockfile folder Schema exist out there in the wild? Some apps like minicom Seem to even allow users to manually specify a lockfile Folder of their choice. Because of the difficulty finding the right lockfile folder, And because of the inherent risk of thinking that something Might be locked while it actually isn't, I'd suggest that RXTX should have a "soft-off" feature that allows disabling ALL Lockfile checks at runtime without recompiling the native Sharedlibs. Trent - I like your strategy outline, but I think that it Needs to be configurable by the client such that users and/or Customer Support can disable lockfiles / disable ioctl in Case they detect that they are runing on an OS / Kernal that Does not support one or the other. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Montag, 28. April 2008 12:22 > To: Stephen Davies > Cc: rxtx at qbang.org; Oberhuber, Martin; Trent Jarvi > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > I don't think there would need to be any architectural > changes. A couple > ifdefs and minor changes in the current code should be enough. > > Proposal: > > FHS/UUCP locks: > continue to respect them, try to create them but do not error if > the IOCTL is supported. (But does the IOCTL being defined mean > it will work?) > Enumeration: > Do not assert the IOCTL while opening. > Serial.open: > assert the IOCTL after open. Continue to use locks as described > above after asserting the IOCTL. If the IOCTL is defined but > not working, handle it here. Failure cases include the IOCTL > is not supported and the port is already locked. > > On Mon, 28 Apr 2008, Stephen Davies wrote: > > > Has anybody done any design work on this? > > The first thing that springs to mind is that we still need > to check for lock > > files because other apps tend to use that approach even if > we go to ioctl. > > > > Cheers, > > Stephen Davies > > > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > >> Thanks Trent. > >> > >> Problem is only that I'm really not at all > >> Familiar with the C part of RXTX. If there > >> Were anything I could do in Java for this, > >> It would be easier for me.... > >> > >> ... Are there any C experts here on the list > >> Who'd like to look at ioctl port locking > >> For linux? > >> > >> Thanks, > >> -- > >> Martin Oberhuber, Senior Member of Technical Staff, Wind River > >> Target Management Project Lead, DSDP PMC Member > >> http://www.eclipse.org/dsdp/tm > >> > >>> -----Original Message----- > >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] > >>> Sent: Donnerstag, 24. April 2008 04:32 > >>> To: Oberhuber, Martin > >>> Cc: rxtx at qbang.org > >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? > >>> > >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > >>>> Dear RXTX community, > >>>> > >>>> I'm wondering what the status is with RXTX locking > >>>> serial ports on Linux? > >>>> > >>>> My understanding is that the mechanism used in > >>>> 2.1-7r2 (lockfiles) is not really state of the art, and > >>>> has lots of problems (e.g. missing permissions). > >>>> > >>>> There was an idea to migrate towards a Kernel > >>>> syscall based solution for port locking. > >>>> > >>>> What's the status here? > >>> > >>> Hi Martin, > >>> > >>> I'm in favor of deprecating the current FHS locking mechanism > >>> in favor of > >>> an IOCTL when available. I think it will be available on all the > >>> platforms but do not know for sure. > >>> > >>> The status is unchanged. I've had very few free cycles for > >>> such things. > >>> Feel free to take a stab at it if you have some time. I > >>> believe the IOCTL > >>> is used in the Mac OS X code already. > >>> > >>> I don't see any real backwards compatability issues and the > >>> IOCTL should > >>> just work. > >>> > >>> -- > >>> Trent Jarvi > >>> tjarvi at qbang.org > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > From Steffen.DETTMER at ingenico.com Tue Apr 29 13:34:44 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 29 Apr 2008 21:34:44 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Message-ID: <20080429193444.GU2928@elberon.bln.de.ingenico.com> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > The biggest problem that I have seen with lockfiles on Linux > At least is, that it seems there is no standard with respect > To the folder in which they should be created. Also, many > Distributions seem to set up file system permissions in such > A way that writing to the lockfile folder is not allowed for > The normal user -- that's why we stopped using lockfiles > In our commercial product. It seems it depends on the expectations. I consider it as a feature that by default a linux user cannot access serial ports. Maybe root connected a modem (can produce phone bills) or even some serial card reader, maybe with the web servers key pair. I would expect that by default a user cannot open the serial port because of insufficient permissions on the device file. I would expect this on other unices as well (but I don't know it). For windows I think it should be similar but not impacting so much in practice, because often windows users work with big permissions on a somewhat high priviledge level or even Administrator. > If we are to still respect lockfiles, we first need to > Understand where we are expected to look for them. Does > Anybody have any insight what variants of lockfile folder > Schema exist out there in the wild? Some apps like minicom > Seem to even allow users to manually specify a lockfile > Folder of their choice. At least my (ancient) minicom does not allow the user to change this option, it is displayed but read-only, but root is allowed to change it. > Because of the difficulty finding the right lockfile folder, > And because of the inherent risk of thinking that something > Might be locked while it actually isn't, I'd suggest that > RXTX should have a "soft-off" feature that allows disabling > ALL Lockfile checks at runtime without recompiling the native > Sharedlibs. sounds very reasonable, yes... and as admin I would not wish that users could skip such locking because they do things wrong by default ;) (in the end I guess that is related to the dilemma, that hotplug/user-owned-periphery and multi-user systems simply conflict) > Trent - I like your strategy outline, but I think that it > Needs to be configurable by the client such that users and/or > Customer Support can disable lockfiles / disable ioctl in > Case they detect that they are runing on an OS / Kernal that > Does not support one or the other. Yes, this would be good I guess... Applications could offer configuration options to control that, maybe similarily as minicom. BTW, man minicom tells: *B - Lock file location On most systems This should be /usr/spool/uucp. Linux systems use /var/lock. If this directory does not exist, minicom will not attempt to use lockfiles. The statement `Linux systems use /var/lock' is interesting, does anyone know the source of this convention? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Tue Apr 29 16:11:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Apr 2008 16:11:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? These details are outlined in the Filesystem Hierarchy Standard (FHS). http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLOCKLOCKFILES -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Tue Apr 29 18:58:09 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Wed, 30 Apr 2008 10:28:09 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: <200804301028.09307.scldad@sdc.com.au> I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is the same. Any ideas as to how to handle this? Stephen On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: > * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > > The biggest problem that I have seen with lockfiles on Linux > > At least is, that it seems there is no standard with respect > > To the folder in which they should be created. Also, many > > Distributions seem to set up file system permissions in such > > A way that writing to the lockfile folder is not allowed for > > The normal user -- that's why we stopped using lockfiles > > In our commercial product. > > It seems it depends on the expectations. I consider it as a > feature that by default a linux user cannot access serial ports. > Maybe root connected a modem (can produce phone bills) or even > some serial card reader, maybe with the web servers key pair. > > I would expect that by default a user cannot open the serial port > because of insufficient permissions on the device file. I would > expect this on other unices as well (but I don't know it). > > For windows I think it should be similar but not impacting so > much in practice, because often windows users work with big > permissions on a somewhat high priviledge level or even > Administrator. > > > If we are to still respect lockfiles, we first need to > > Understand where we are expected to look for them. Does > > Anybody have any insight what variants of lockfile folder > > Schema exist out there in the wild? Some apps like minicom > > Seem to even allow users to manually specify a lockfile > > Folder of their choice. > > At least my (ancient) minicom does not allow the user to change > this option, it is displayed but read-only, but root is allowed > to change it. > > > Because of the difficulty finding the right lockfile folder, > > And because of the inherent risk of thinking that something > > Might be locked while it actually isn't, I'd suggest that > > RXTX should have a "soft-off" feature that allows disabling > > ALL Lockfile checks at runtime without recompiling the native > > Sharedlibs. > > sounds very reasonable, yes... > and as admin I would not wish that users could skip such > locking because they do things wrong by default ;) > > (in the end I guess that is related to the dilemma, that > hotplug/user-owned-periphery and multi-user systems simply > conflict) > > > Trent - I like your strategy outline, but I think that it > > Needs to be configurable by the client such that users and/or > > Customer Support can disable lockfiles / disable ioctl in > > Case they detect that they are runing on an OS / Kernal that > > Does not support one or the other. > > Yes, this would be good I guess... Applications could offer > configuration options to control that, maybe similarily as > minicom. > > BTW, man minicom tells: > > *B - Lock file location > On most systems This should be /usr/spool/uucp. > Linux systems use /var/lock. If this directory > does not exist, minicom will not attempt to use > lockfiles. > > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure > and expedient electronic transaction acceptance. Ingenico products leverage > proven technology, established standards and unparalleled ergonomics to > provide optimal reliability, versatility and usability. This comprehensive > range of products is complemented by a global array of services and > partnerships, enabling businesses in a number of vertical sectors to accept > transactions anywhere their business takes them. www.ingenico.com This > message may contain confidential and/or privileged information. If you are > not the addressee or authorized to receive this for the addressee, you must > not use, copy, disclose or take any action based on this message or any > information herein. If you have received this message in error, please > advise the sender immediately by reply e-mail and delete this message. > Thank you for your cooperation. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Wed Apr 30 19:30:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 30 Apr 2008 19:30:51 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804301028.09307.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> <200804301028.09307.scldad@sdc.com.au> Message-ID: Hi Stephen, I suspect ioctl/TIOCEXCL open/O_EXCL would do the job. Mac uses TIOCEXCL and it is POSIX. We use O_EXCL for lockfiles on Linux already. On Wed, 30 Apr 2008, Stephen Davies wrote: > I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is > the same. > > Any ideas as to how to handle this? > > Stephen > > > On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: >> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: >>> The biggest problem that I have seen with lockfiles on Linux >>> At least is, that it seems there is no standard with respect >>> To the folder in which they should be created. Also, many >>> Distributions seem to set up file system permissions in such >>> A way that writing to the lockfile folder is not allowed for >>> The normal user -- that's why we stopped using lockfiles >>> In our commercial product. >> >> It seems it depends on the expectations. I consider it as a >> feature that by default a linux user cannot access serial ports. >> Maybe root connected a modem (can produce phone bills) or even >> some serial card reader, maybe with the web servers key pair. >> >> I would expect that by default a user cannot open the serial port >> because of insufficient permissions on the device file. I would >> expect this on other unices as well (but I don't know it). >> >> For windows I think it should be similar but not impacting so >> much in practice, because often windows users work with big >> permissions on a somewhat high priviledge level or even >> Administrator. >> >>> If we are to still respect lockfiles, we first need to >>> Understand where we are expected to look for them. Does >>> Anybody have any insight what variants of lockfile folder >>> Schema exist out there in the wild? Some apps like minicom >>> Seem to even allow users to manually specify a lockfile >>> Folder of their choice. >> >> At least my (ancient) minicom does not allow the user to change >> this option, it is displayed but read-only, but root is allowed >> to change it. >> >>> Because of the difficulty finding the right lockfile folder, >>> And because of the inherent risk of thinking that something >>> Might be locked while it actually isn't, I'd suggest that >>> RXTX should have a "soft-off" feature that allows disabling >>> ALL Lockfile checks at runtime without recompiling the native >>> Sharedlibs. >> >> sounds very reasonable, yes... >> and as admin I would not wish that users could skip such >> locking because they do things wrong by default ;) >> >> (in the end I guess that is related to the dilemma, that >> hotplug/user-owned-periphery and multi-user systems simply >> conflict) >> >>> Trent - I like your strategy outline, but I think that it >>> Needs to be configurable by the client such that users and/or >>> Customer Support can disable lockfiles / disable ioctl in >>> Case they detect that they are runing on an OS / Kernal that >>> Does not support one or the other. >> >> Yes, this would be good I guess... Applications could offer >> configuration options to control that, maybe similarily as >> minicom. >> >> BTW, man minicom tells: >> >> *B - Lock file location >> On most systems This should be /usr/spool/uucp. >> Linux systems use /var/lock. If this directory >> does not exist, minicom will not attempt to use >> lockfiles. >> >> The statement `Linux systems use /var/lock' is interesting, does >> anyone know the source of this convention? >> >> oki, >> >> Steffen >> >> About Ingenico Throughout the world businesses rely on Ingenico for secure >> and expedient electronic transaction acceptance. Ingenico products leverage >> proven technology, established standards and unparalleled ergonomics to >> provide optimal reliability, versatility and usability. This comprehensive >> range of products is complemented by a global array of services and >> partnerships, enabling businesses in a number of vertical sectors to accept >> transactions anywhere their business takes them. www.ingenico.com This >> message may contain confidential and/or privileged information. If you are >> not the addressee or authorized to receive this for the addressee, you must >> not use, copy, disclose or take any action based on this message or any >> information herein. If you have received this message in error, please >> advise the sender immediately by reply e-mail and delete this message. >> Thank you for your cooperation. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0076.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0074.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0061.html From pboulton at pulsetracer.com Fri Apr 18 14:30:13 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Fri, 18 Apr 2008 13:30:13 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site Message-ID: <480904D5.1060307@pulsetracer.com> Hello, gentle serial porters. I have downloaded the zipped up binaries for use on Windows without Sun's CommAPI, but don't seem able to extract anything from the download. Go to main page, http://www.rxtx.org/ Click on Downloads I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) And I save it to disk. If I try and extract the files with WinZip, Winzip thinks the archive is corrupt. If I try using Windows Explorer, I am able to extract it into a single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than the original .zip. Any help would be much appreciated. Sincerely, Philip Boulton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080418/97d89793/attachment-0059.html From tjarvi at qbang.org Fri Apr 18 19:07:00 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 18 Apr 2008 19:07:00 -0600 (MDT) Subject: [Rxtx] Difficulty opening zip file at rxtx site In-Reply-To: <480904D5.1060307@pulsetracer.com> References: <480904D5.1060307@pulsetracer.com> Message-ID: On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org From pboulton at pulsetracer.com Sat Apr 19 12:46:26 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Sat, 19 Apr 2008 11:46:26 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site References: <480904D5.1060307@pulsetracer.com> Message-ID: <53DB7576450695419E09299104043761A78533@ZTGSERVER.ztg.local> I have been able to get my hands on the binaries, by going to the ftp directory /pub/rxtx at ftp.qbang.org,, and ftping the file rxtx-2.1-7-bins-r2.zip . This opens happily with Winzip, and extracts as the set of files that you describe below. I only experience the ill-formed archive problem by clicking the link on the rxtx.org Downloads page (http://rxtx.qbang.org/pub/rxtx/ rxtx-2.1-7-bins-r2.zip ). Not sure what to make of that. Philip Boulton ________________________________ From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Fri 4/18/2008 6:07 PM To: Philip Boulton Cc: rxtx at qbang.org Subject: Re: [Rxtx] Difficulty opening zip file at rxtx site On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080419/147923bb/attachment-0058.html From jlar310 at gmail.com Sat Apr 19 19:11:55 2008 From: jlar310 at gmail.com (Jeff Larsen) Date: Sat, 19 Apr 2008 20:11:55 -0500 Subject: [Rxtx] Moxa serial over Ethernet driver Message-ID: Hi all, I've been using javax.comm for years to communicate with a legacy radio data system. We want to migrate the java side of the system to a VMware Server virtual machine. We've had great success using Moxa DE-303 and 5610 serial over Ethernet appliances and virtual machines for running hylafax. The OS (Linux in this case) uses a kernel driver to communicate with the Moxa via a virtual serial port such as /dev/ttyr00. I want to do the same thing with javax.comm or gnu.io to connect to a virtual serial port. However I'm hitting road blocks everywhere. javax.comm for Linux sees the virtual port, but there are transmission errors. Tried Solaris too, but the Solaris Moxa drivers don't play nice with javax.comm because the driver uses /dev/pts/n instead of /dev/term/x. Next I tried RXTX on Linux, but I'm getting NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX on Solaris. Has anyone used RXTX with serial over Ethernet devices? Any hints on how to make it work? I know that I'm not completely off track because javax.comm does work with Moxa on a Windows platform, but that's just not an option for production deployment. -- Jeff From tjarvi at qbang.org Sat Apr 19 21:08:41 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 19 Apr 2008 21:08:41 -0600 (MDT) Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: yOn Sat, 19 Apr 2008, Jeff Larsen wrote: > Hi all, > > I've been using javax.comm for years to communicate with a legacy > radio data system. We want to migrate the java side of the system to a > VMware Server virtual machine. We've had great success using Moxa > DE-303 and 5610 serial over Ethernet appliances and virtual machines > for running hylafax. The OS (Linux in this case) uses a kernel driver > to communicate with the Moxa via a virtual serial port such as > /dev/ttyr00. > > I want to do the same thing with javax.comm or gnu.io to connect to a > virtual serial port. However I'm hitting road blocks everywhere. > javax.comm for Linux sees the virtual port, but there are transmission > errors. Tried Solaris too, but the Solaris Moxa drivers don't play > nice with javax.comm because the driver uses /dev/pts/n instead of > /dev/term/x. Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris. > > Has anyone used RXTX with serial over Ethernet devices? Any hints on > how to make it work? > > I know that I'm not completely off track because javax.comm does work > with Moxa on a Windows platform, but that's just not an option for > production deployment. > > Moxa should work under linux. There may be minor issues depending upon how complete the kernel driver is but I think it will work. One of the minor issues is /dev/ttyr00 is not enumerated. There are several work arounds documented with the source code and on the wiki. The easiest solution for testing purposes is to make a symbolic link from /dev/ttyr00 to a port that is enumerated such as /dev/ttyS129. You can later alter the rxtx source or use properties to change the enumerated ports. -- Trent Jarvi tjarvi at qbang.org From d.tonhofer at m-plify.com Sun Apr 20 03:33:30 2008 From: d.tonhofer at m-plify.com (David Tonhofer (M-PLIFY S.A.)) Date: Sun, 20 Apr 2008 11:33:30 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: <480B0DEA.5010908@m-plify.com> Jeff Larsen wrote: > Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris It might be that the Java side of RXTX does not recognize that portname. Trying modifying src/RXTXCommDriver.java as described in this case: http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card From ajmas at sympatico.ca Sun Apr 20 16:37:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Apr 2008 18:37:59 -0400 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <480B0DEA.5010908@m-plify.com> References: <480B0DEA.5010908@m-plify.com> Message-ID: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > Jeff Larsen wrote: >> Next I tried RXTX on Linux, but I'm getting >> NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX >> on Solaris > It might be that the Java side of RXTX does not recognize that > portname. > Trying modifying src/RXTXCommDriver.java as described in this case: > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card I wonder whether it would be worth allowing custom port prefixes as a system parameter? For example: gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" Andre From Martin.Oberhuber at windriver.com Tue Apr 22 12:34:36 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 22 Apr 2008 20:34:36 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> References: <480B0DEA.5010908@m-plify.com> <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE6485848056CD6CE@ism-mail03.corp.ad.wrs.com> Sounds like a great idea... I'm wondering how the "variable part" after the Prefixes could be specified though? What about allowing Regular Expression character Classes in the existing System Property for specifying ports: System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyS[0-9],ttyS[ABC],ttyUSB[0-9a-z]"); The set of allowed patterns would of course need to Be restricted compared to REGEX, because it must be A syntax that supports iterating over it. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Montag, 21. April 2008 00:38 > To: rxtx at qbang.org and Users > Subject: Re: [Rxtx] Moxa serial over Ethernet driver > > > On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > > Jeff Larsen wrote: > >> Next I tried RXTX on Linux, but I'm getting > >> NoSuchPortException connecting to /dev/ttyr00. I have yet > to try RXTX > >> on Solaris > > It might be that the Java side of RXTX does not recognize that > > portname. > > Trying modifying src/RXTXCommDriver.java as described in this case: > > > > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_ > SST-4P.2FLP_multiport_card > > I wonder whether it would be worth allowing custom port > prefixes as a > system parameter? For > example: > > gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Loi.TRAN at weatherford.com Tue Apr 22 13:10:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Tue, 22 Apr 2008 14:10:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled Message-ID: Hi, I'm currently using the Java RXTX API to interface to a serial port. The serial port is connected to a bridge board that communicates with our communications system running at 1.875 Mbps which is linked to an embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no flow control). I send a command to the embedded board through the serial-bridge board which then is relayed to the embedded board. The command sent asks the embedded board to dump a binary image. Here's where I'm hitting some problems. I've successfully done this is an integrated serial port from the laptop. The binary file that comes back is consistent on every attempt. When I use the application I've written to do the same thing with a USB-to-serial adapter, the image I get back is not the same as the image I receive through the USB-to-serial adapter is not consistent at all. A final thing is that when I use a terminal program to dump the binary image with the USB-serial adapter, the image is correct. Every time! What is the terminal program doing that's not being done in my application? My application is quite simple. Has anyone observed this behavior before? If you have, I'd like to know how you've gotten around this problem. Thanks, LT =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From tjarvi at qbang.org Tue Apr 22 21:11:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 22 Apr 2008 21:11:10 -0600 (MDT) Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org From Loi.TRAN at weatherford.com Wed Apr 23 08:35:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Wed, 23 Apr 2008 09:35:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: Thanks for all the responses. I finally tried something that worked consistently. I updated my Prolific driver and repeated my tests. It worked. If you're using the Prolific type USB-serial adapters, do no use the Prolific version 2.0.2.1 driver on Windows. Update it to the latest 2.0.2.8 version. Again, thanks for all the responses. LT -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Tuesday, April 22, 2008 10:11 PM To: TRAN, Loi X. Cc: rxtx at qbang.org Subject: Re: [Rxtx] Prolific USB - RXTX data mangled On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From Martin.Oberhuber at windriver.com Wed Apr 23 18:54:26 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 02:54:26 +0200 Subject: [Rxtx] RXTX port locking on Linux status? Message-ID: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Dear RXTX community, I'm wondering what the status is with RXTX locking serial ports on Linux? My understanding is that the mechanism used in 2.1-7r2 (lockfiles) is not really state of the art, and has lots of problems (e.g. missing permissions). There was an idea to migrate towards a Kernel syscall based solution for port locking. What's the status here? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/9878db9f/attachment-0054.html From tjarvi at qbang.org Wed Apr 23 20:32:24 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Apr 2008 20:32:24 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > Dear RXTX community, > > I'm wondering what the status is with RXTX locking > serial ports on Linux? > > My understanding is that the mechanism used in > 2.1-7r2 (lockfiles) is not really state of the art, and > has lots of problems (e.g. missing permissions). > > There was an idea to migrate towards a Kernel > syscall based solution for port locking. > > What's the status here? > Hi Martin, I'm in favor of deprecating the current FHS locking mechanism in favor of an IOCTL when available. I think it will be available on all the platforms but do not know for sure. The status is unchanged. I've had very few free cycles for such things. Feel free to take a stab at it if you have some time. I believe the IOCTL is used in the Mac OS X code already. I don't see any real backwards compatability issues and the IOCTL should just work. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Apr 24 06:14:06 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 14:14:06 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Thanks Trent. Problem is only that I'm really not at all Familiar with the C part of RXTX. If there Were anything I could do in Java for this, It would be easier for me.... ... Are there any C experts here on the list Who'd like to look at ioctl port locking For linux? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Donnerstag, 24. April 2008 04:32 > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > I'm wondering what the status is with RXTX locking > > serial ports on Linux? > > > > My understanding is that the mechanism used in > > 2.1-7r2 (lockfiles) is not really state of the art, and > > has lots of problems (e.g. missing permissions). > > > > There was an idea to migrate towards a Kernel > > syscall based solution for port locking. > > > > What's the status here? > > > > Hi Martin, > > I'm in favor of deprecating the current FHS locking mechanism > in favor of > an IOCTL when available. I think it will be available on all the > platforms but do not know for sure. > > The status is unchanged. I've had very few free cycles for > such things. > Feel free to take a stab at it if you have some time. I > believe the IOCTL > is used in the Mac OS X code already. > > I don't see any real backwards compatability issues and the > IOCTL should > just work. > > -- > Trent Jarvi > tjarvi at qbang.org > From sspies at sloc.de Thu Apr 24 07:15:36 2008 From: sspies at sloc.de (Sebastian Spies) Date: Thu, 24 Apr 2008 15:15:36 +0200 (CEST) Subject: [Rxtx] rxtx on gumstix: Interrupted system call In-Reply-To: <47FB7B20.7080504@sloc.de> References: <47FB7B20.7080504@sloc.de> Message-ID: <55445.130.83.139.205.1209042936.squirrel@ssl.sloc.de> Dear list, while porting rxtx to the gumstix, I found out, that select used in readArray in SerialImp.c might not work as expected. Maybe, because of missing TIOCSERGETLSR-support? select is often interrupted, so i wrote the following quick'n'dirty hack to make it work on gumstix: diff -Nur rxtx-2.1-7r2/src/SerialImp.c rxtx-2.1-7r2/src/SerialImp.c --- rxtx-2.1-7r2/src/SerialImp.c 2006-01-29 23:19:04.000000000 +0100 +++ rxtx-2.1-7r2-patched/src/SerialImp.c 2008-04-24 14:30:17.000000000 +0200 @@ -3380,7 +3381,7 @@ JNIEXPORT jint JNICALL RXTXPort(readArray)( JNIEnv *env, jobject jobj, jbyteArray jbarray, jint offset, jint length ) { - int bytes; + int bytes = 0; jbyte *body; /* char msg[80]; */ int fd = get_java_var( env, jobj, "fd", "I" ); @@ -3397,9 +3398,18 @@ "readArray", "Invalid length" ); return -1; } - body = (*env)->GetByteArrayElements( env, jbarray, 0 ); - bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ - (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + while(1 > bytes) + { + body = (*env)->GetByteArrayElements( env, jbarray, 0 ); + bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ + (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + // quick'n'dirty - SSP + report (" trying again... \n"); + errno = 0; + } + if( bytes < 0 ) { report( "RXTXPort:readArray bytes < 0" ); LEAVE( "RXTXPort:readArray" ); > Hey, > > I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use > RXTXPort$SerialInputStream.read(), then I get the following Exception. I > did not yet figure out which system call is interrupted as strace > produces loads of output. > > Any help would be very appreciated. Thanks in advance. > Sebastian > > > [java] java.io.IOException: Interrupted system call in readArray > [java] at gnu.io.RXTXPort.readArray(Native Method) > [java] at > gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) > [java] at > java.io.FilterInputStream.read(FilterInputStream.java:189) > [java] at > java.io.BufferedInputStream.refill(BufferedInputStream.java:371) > [java] at > java.io.BufferedInputStream.read(BufferedInputStream.java:229) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) > [java] at > com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) > > -- > Sebastian Spies > > mail: sspies at sloc.de > > > > From fire_baptized at hotmail.com Thu Apr 24 18:27:48 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Thu, 24 Apr 2008 20:27:48 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hello I am having a problem with the serial device connecting (software wise) to the serial port. However I have a test program and it seems to work just fine in that environment - and it doesnt use GUI. The error I am getting is : PortNotFoundException Now the way I have it setup in the GUI environment is that once the user pushes a JButton the program connects using this class: protected void establishConnection() { try { portId = CommPortIdentifier.getPortIdentifier("COM3"); System.out.println("Establishing connction....."); messages[0] = "\nEstablishing connction.....\n"; } catch ( NoSuchPortException noport) { System.out.println("Port not found: "+ noport); messages[0] = "Port not found: "+ noport+"\n"; } try { serialPort = (SerialPort) portId.open("serial", 50); System.out.println("Port has been found."); messages[1] = "Port has been found.\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[1] = "" +usedport; } try { serialPort = (SerialPort) portId.open("serial", 50); messages[2] = "Connecting to COM3 on port 50....\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; } try { serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); System.out.println("Esablishing the transfer rate settings for COM3."); messages[3] = "Esablishing the transfer rate settings for COM3.\n"; } catch (UnsupportedCommOperationException nosupcom) { System.out.println(nosupcom); System.out.println("The tranfer rate could not be esblished on COM3."); messages[3] = "The tranfer rate could not be esblished on COM3.\n"; } System.out.println(serialPort.getFlowControlMode()); messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; //sendDataOut(buffer[3],buffer[4]); } I need all the data in this method (and all the string values in this method) to be printed out on a JTextArea. I wont do me any good if not all the text is printed on a JTextArea in another class. So I have the text printing the JTextArea correctly, but everytime the JButton is activated - it gives me that error message. I did add a disconnect button that is supposed to call the serialPort.close(). _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/273fd4ec/attachment-0053.html From tjarvi at qbang.org Thu Apr 24 21:54:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Apr 2008 21:54:10 -0600 (MDT) Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > Hello I am having a problem with the serial device connecting (software > wise) to the serial port. However I have a test program and it seems to > work just fine in that environment - and it doesnt use GUI. The error I > am getting is : PortNotFoundException Now the way I have it setup in the > GUI environment is that once the user pushes a JButton the program > connects using this class: > > protected void establishConnection() { > try { > portId = CommPortIdentifier.getPortIdentifier("COM3"); > System.out.println("Establishing connction....."); > messages[0] = "\nEstablishing connction.....\n"; > } > catch ( NoSuchPortException noport) { > System.out.println("Port not found: "+ noport); > messages[0] = "Port not found: "+ noport+"\n"; > } > try { > serialPort = (SerialPort) portId.open("serial", 50); > System.out.println("Port has been found."); > messages[1] = "Port has been found.\n"; > } > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[1] = "" +usedport; > } ================================================================= > try { > serialPort = (SerialPort) portId.open("serial", 50); > messages[2] = "Connecting to COM3 on port 50....\n"; > } ================================================================== > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > } > try { > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > System.out.println("Esablishing the transfer rate settings for COM3."); > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > } > catch (UnsupportedCommOperationException nosupcom) { > System.out.println(nosupcom); > System.out.println("The tranfer rate could not be esblished on COM3."); > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > } > System.out.println(serialPort.getFlowControlMode()); > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > //sendDataOut(buffer[3],buffer[4]); > } > > I need all the data in this method (and all the string values in this > method) to be printed out on a JTextArea. I wont do me any good if not > all the text is printed on a JTextArea in another class. So I have the > text printing the JTextArea correctly, but everytime the JButton is > activated - it gives me that error message. I did add a disconnect > button that is supposed to call the serialPort.close(). > The open code used twice is going to throw an exception. It may be that you catch the exception above this code and print a confusing message? A common mistake is people will accidently run two copies of their program. The first instance of the program will open the port and prevent enumeration (finding the port) in the second instance of the program. As an example, you may be running your text based application which is preventing the GUI from seeing the port. Enumeration is done by trying to open the port. If the port is open, Enumeration fails. -- Trent Jarvi tjarvi at qbang.org From fire_baptized at hotmail.com Thu Apr 24 22:32:05 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 00:32:05 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Wow - thanks dude what a dumb thing for me to not catch..... now here is the current problem - right now I am trying to output data again one is with the test program - and it seems that serialPort.setRTS(true); is throwing an exceptions there - now if I show this code please bare in mind that I am only testing - the code is kinda sloppy in my mind - but if I can figure out why calling this function is throwing an exception then maybe I can figure out why my GUI application is getting the same null pointer exceptions when try to send out the data stream. FYI Trent this email is not directed towards you - anyone can jump in on this public static void main(String args[]) { byte[] b = new byte[64]; int keyinput = 0 ; byte x = 0; byte y = 0; PortTesting1 testports = new PortTesting1(); try { joyskoro = Joystick.createInstance(); } catch (IOException ioexc) { System.out.println("There is an input/output problem: " + ioexc); } while (true) { joyskoro.poll(); b[0] = ((byte) -(10 * joyskoro.getY())); b[1] = ((byte) (10 * joyskoro.getX())); System.out.println("The 3rd byte is: " +b[0]); System.out.println("The 4rd byte is: " +b[1]); serialPort.setRTS(true); // HERE IS WHERE THE PROBLEM IS !!!!!!! ON THIS LINE but if I dont have it active in my program the Bluetooth device (that is System.out.println("Ready to send :-) !"); //connected to the serial port does not send out data!!!!! if (joyskoro.isButtonDown(joyskoro.BUTTON10)) { System.out.println("Connection terminated."); serialPort.close(); break; } if (joyskoro.isButtonDown(joyskoro.BUTTON2)) { boolean flag = true; //reading from key input from the keyboard System.out.println("Please input a command: "); while (flag) { try { keyinput = System.in.read(); } catch (IOException ioexc) {/*there is no need to put * anything here */ } if((char)keyinput=='w') { pushIt((byte)85); } if((char)keyinput=='s') { pushIt((byte)84); } if((char)keyinput=='a') { pushIt((byte)83); } if((char)keyinput=='d') { pushIt((byte)82); } if((char)keyinput=='q') { pushIt((byte)89); } if((char)keyinput=='\t') { //this stop reading input from the keyboard flag = false; } } and help anyways here is the block of code that throwing an exception for the test program: > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/5c8f7d68/attachment-0053.html From fire_baptized at hotmail.com Fri Apr 25 07:59:53 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 09:59:53 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Are there any examples of how to push out data? As in using input and output streams - if I can compare code maybe I can see where this is causing a problem. I have a byte array that I am pushing out data. I keep getting null pointer exceptions every where I turn. > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/22228ab6/attachment-0052.html From ajmas at sympatico.ca Sat Apr 26 07:37:09 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sat, 26 Apr 2008 09:37:09 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hi, On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote: > > Are there any examples of how to push out data? As in using input > and output streams - if I can compare code maybe I can see where > this is causing a problem. I have a byte array that I am pushing > out data. I keep getting null pointer exceptions every where I turn. > There are some examples here that might be of help: http://rxtx.qbang.org/wiki/index.php/Examples Andre From fire_baptized at hotmail.com Sat Apr 26 20:13:54 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Sat, 26 Apr 2008 22:13:54 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: looked at those....yep didnt help - I need to push out data with GUI and not get a null pointer exception everytime I try. > CC: rxtx at qbang.org> From: ajmas at sympatico.ca> To: fire_baptized at hotmail.com> Subject: Re: [Rxtx] Serial Problems with Gui.....> Date: Sat, 26 Apr 2008 09:37:09 -0400> > Hi,> > > On 25-Apr-08, at 09:59 , Jesrael D. Summerhill wrote:> >> > Are there any examples of how to push out data? As in using input > > and output streams - if I can compare code maybe I can see where > > this is causing a problem. I have a byte array that I am pushing > > out data. I keep getting null pointer exceptions every where I turn.> >> > There are some examples here that might be of help:> > http://rxtx.qbang.org/wiki/index.php/Examples> > Andre _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080426/09f95b41/attachment-0051.html From michael.erskine at ketech.com Mon Apr 28 02:47:22 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 28 Apr 2008 09:47:22 +0100 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D426EF3CBBC5@no-sv-03.ketech.local> Jesrael D. Summerhill wrote: > looked at those....yep didnt help - I need to push out data with GUI and > not get a null pointer exception everytime I try. So it seems pretty obvious that your code needs to check for nulls wherever one may occur and report what's happening. Alternatively, catch the npe and display the stack trace. Then you can fix your code so it doesn't try to work with something that ain't there. Regards, Michael Erskine. From scldad at sdc.com.au Mon Apr 28 03:58:34 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Mon, 28 Apr 2008 19:28:34 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Message-ID: <200804281928.34454.scldad@sdc.com.au> Has anybody done any design work on this? The first thing that springs to mind is that we still need to check for lock files because other apps tend to use that approach even if we go to ioctl. Cheers, Stephen Davies On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > Thanks Trent. > > Problem is only that I'm really not at all > Familiar with the C part of RXTX. If there > Were anything I could do in Java for this, > It would be easier for me.... > > ... Are there any C experts here on the list > Who'd like to look at ioctl port locking > For linux? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > -----Original Message----- > > From: Trent Jarvi [mailto:tjarvi at qbang.org] > > Sent: Donnerstag, 24. April 2008 04:32 > > To: Oberhuber, Martin > > Cc: rxtx at qbang.org > > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > > > I'm wondering what the status is with RXTX locking > > > serial ports on Linux? > > > > > > My understanding is that the mechanism used in > > > 2.1-7r2 (lockfiles) is not really state of the art, and > > > has lots of problems (e.g. missing permissions). > > > > > > There was an idea to migrate towards a Kernel > > > syscall based solution for port locking. > > > > > > What's the status here? > > > > Hi Martin, > > > > I'm in favor of deprecating the current FHS locking mechanism > > in favor of > > an IOCTL when available. I think it will be available on all the > > platforms but do not know for sure. > > > > The status is unchanged. I've had very few free cycles for > > such things. > > Feel free to take a stab at it if you have some time. I > > believe the IOCTL > > is used in the Mac OS X code already. > > > > I don't see any real backwards compatability issues and the > > IOCTL should > > just work. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Mon Apr 28 04:21:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 28 Apr 2008 04:21:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804281928.34454.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: I don't think there would need to be any architectural changes. A couple ifdefs and minor changes in the current code should be enough. Proposal: FHS/UUCP locks: continue to respect them, try to create them but do not error if the IOCTL is supported. (But does the IOCTL being defined mean it will work?) Enumeration: Do not assert the IOCTL while opening. Serial.open: assert the IOCTL after open. Continue to use locks as described above after asserting the IOCTL. If the IOCTL is defined but not working, handle it here. Failure cases include the IOCTL is not supported and the port is already locked. On Mon, 28 Apr 2008, Stephen Davies wrote: > Has anybody done any design work on this? > The first thing that springs to mind is that we still need to check for lock > files because other apps tend to use that approach even if we go to ioctl. > > Cheers, > Stephen Davies > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: >> Thanks Trent. >> >> Problem is only that I'm really not at all >> Familiar with the C part of RXTX. If there >> Were anything I could do in Java for this, >> It would be easier for me.... >> >> ... Are there any C experts here on the list >> Who'd like to look at ioctl port locking >> For linux? >> >> Thanks, >> -- >> Martin Oberhuber, Senior Member of Technical Staff, Wind River >> Target Management Project Lead, DSDP PMC Member >> http://www.eclipse.org/dsdp/tm >> >>> -----Original Message----- >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] >>> Sent: Donnerstag, 24. April 2008 04:32 >>> To: Oberhuber, Martin >>> Cc: rxtx at qbang.org >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? >>> >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: >>>> Dear RXTX community, >>>> >>>> I'm wondering what the status is with RXTX locking >>>> serial ports on Linux? >>>> >>>> My understanding is that the mechanism used in >>>> 2.1-7r2 (lockfiles) is not really state of the art, and >>>> has lots of problems (e.g. missing permissions). >>>> >>>> There was an idea to migrate towards a Kernel >>>> syscall based solution for port locking. >>>> >>>> What's the status here? >>> >>> Hi Martin, >>> >>> I'm in favor of deprecating the current FHS locking mechanism >>> in favor of >>> an IOCTL when available. I think it will be available on all the >>> platforms but do not know for sure. >>> >>> The status is unchanged. I've had very few free cycles for >>> such things. >>> Feel free to take a stab at it if you have some time. I >>> believe the IOCTL >>> is used in the Mac OS X code already. >>> >>> I don't see any real backwards compatability issues and the >>> IOCTL should >>> just work. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From Martin.Oberhuber at windriver.com Tue Apr 29 12:04:04 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 29 Apr 2008 20:04:04 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> Message-ID: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Hi all, The biggest problem that I have seen with lockfiles on Linux At least is, that it seems there is no standard with respect To the folder in which they should be created. Also, many Distributions seem to set up file system permissions in such A way that writing to the lockfile folder is not allowed for The normal user -- that's why we stopped using lockfiles In our commercial product. If we are to still respect lockfiles, we first need to Understand where we are expected to look for them. Does Anybody have any insight what variants of lockfile folder Schema exist out there in the wild? Some apps like minicom Seem to even allow users to manually specify a lockfile Folder of their choice. Because of the difficulty finding the right lockfile folder, And because of the inherent risk of thinking that something Might be locked while it actually isn't, I'd suggest that RXTX should have a "soft-off" feature that allows disabling ALL Lockfile checks at runtime without recompiling the native Sharedlibs. Trent - I like your strategy outline, but I think that it Needs to be configurable by the client such that users and/or Customer Support can disable lockfiles / disable ioctl in Case they detect that they are runing on an OS / Kernal that Does not support one or the other. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Montag, 28. April 2008 12:22 > To: Stephen Davies > Cc: rxtx at qbang.org; Oberhuber, Martin; Trent Jarvi > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > > I don't think there would need to be any architectural > changes. A couple > ifdefs and minor changes in the current code should be enough. > > Proposal: > > FHS/UUCP locks: > continue to respect them, try to create them but do not error if > the IOCTL is supported. (But does the IOCTL being defined mean > it will work?) > Enumeration: > Do not assert the IOCTL while opening. > Serial.open: > assert the IOCTL after open. Continue to use locks as described > above after asserting the IOCTL. If the IOCTL is defined but > not working, handle it here. Failure cases include the IOCTL > is not supported and the port is already locked. > > On Mon, 28 Apr 2008, Stephen Davies wrote: > > > Has anybody done any design work on this? > > The first thing that springs to mind is that we still need > to check for lock > > files because other apps tend to use that approach even if > we go to ioctl. > > > > Cheers, > > Stephen Davies > > > > On Thursday 24 April 2008 21:44, Oberhuber, Martin wrote: > >> Thanks Trent. > >> > >> Problem is only that I'm really not at all > >> Familiar with the C part of RXTX. If there > >> Were anything I could do in Java for this, > >> It would be easier for me.... > >> > >> ... Are there any C experts here on the list > >> Who'd like to look at ioctl port locking > >> For linux? > >> > >> Thanks, > >> -- > >> Martin Oberhuber, Senior Member of Technical Staff, Wind River > >> Target Management Project Lead, DSDP PMC Member > >> http://www.eclipse.org/dsdp/tm > >> > >>> -----Original Message----- > >>> From: Trent Jarvi [mailto:tjarvi at qbang.org] > >>> Sent: Donnerstag, 24. April 2008 04:32 > >>> To: Oberhuber, Martin > >>> Cc: rxtx at qbang.org > >>> Subject: Re: [Rxtx] RXTX port locking on Linux status? > >>> > >>> On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > >>>> Dear RXTX community, > >>>> > >>>> I'm wondering what the status is with RXTX locking > >>>> serial ports on Linux? > >>>> > >>>> My understanding is that the mechanism used in > >>>> 2.1-7r2 (lockfiles) is not really state of the art, and > >>>> has lots of problems (e.g. missing permissions). > >>>> > >>>> There was an idea to migrate towards a Kernel > >>>> syscall based solution for port locking. > >>>> > >>>> What's the status here? > >>> > >>> Hi Martin, > >>> > >>> I'm in favor of deprecating the current FHS locking mechanism > >>> in favor of > >>> an IOCTL when available. I think it will be available on all the > >>> platforms but do not know for sure. > >>> > >>> The status is unchanged. I've had very few free cycles for > >>> such things. > >>> Feel free to take a stab at it if you have some time. I > >>> believe the IOCTL > >>> is used in the Mac OS X code already. > >>> > >>> I don't see any real backwards compatability issues and the > >>> IOCTL should > >>> just work. > >>> > >>> -- > >>> Trent Jarvi > >>> tjarvi at qbang.org > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > From Steffen.DETTMER at ingenico.com Tue Apr 29 13:34:44 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 29 Apr 2008 21:34:44 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> Message-ID: <20080429193444.GU2928@elberon.bln.de.ingenico.com> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > The biggest problem that I have seen with lockfiles on Linux > At least is, that it seems there is no standard with respect > To the folder in which they should be created. Also, many > Distributions seem to set up file system permissions in such > A way that writing to the lockfile folder is not allowed for > The normal user -- that's why we stopped using lockfiles > In our commercial product. It seems it depends on the expectations. I consider it as a feature that by default a linux user cannot access serial ports. Maybe root connected a modem (can produce phone bills) or even some serial card reader, maybe with the web servers key pair. I would expect that by default a user cannot open the serial port because of insufficient permissions on the device file. I would expect this on other unices as well (but I don't know it). For windows I think it should be similar but not impacting so much in practice, because often windows users work with big permissions on a somewhat high priviledge level or even Administrator. > If we are to still respect lockfiles, we first need to > Understand where we are expected to look for them. Does > Anybody have any insight what variants of lockfile folder > Schema exist out there in the wild? Some apps like minicom > Seem to even allow users to manually specify a lockfile > Folder of their choice. At least my (ancient) minicom does not allow the user to change this option, it is displayed but read-only, but root is allowed to change it. > Because of the difficulty finding the right lockfile folder, > And because of the inherent risk of thinking that something > Might be locked while it actually isn't, I'd suggest that > RXTX should have a "soft-off" feature that allows disabling > ALL Lockfile checks at runtime without recompiling the native > Sharedlibs. sounds very reasonable, yes... and as admin I would not wish that users could skip such locking because they do things wrong by default ;) (in the end I guess that is related to the dilemma, that hotplug/user-owned-periphery and multi-user systems simply conflict) > Trent - I like your strategy outline, but I think that it > Needs to be configurable by the client such that users and/or > Customer Support can disable lockfiles / disable ioctl in > Case they detect that they are runing on an OS / Kernal that > Does not support one or the other. Yes, this would be good I guess... Applications could offer configuration options to control that, maybe similarily as minicom. BTW, man minicom tells: *B - Lock file location On most systems This should be /usr/spool/uucp. Linux systems use /var/lock. If this directory does not exist, minicom will not attempt to use lockfiles. The statement `Linux systems use /var/lock' is interesting, does anyone know the source of this convention? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From tjarvi at qbang.org Tue Apr 29 16:11:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 Apr 2008 16:11:57 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> <200804281928.34454.scldad@sdc.com.au> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? These details are outlined in the Filesystem Hierarchy Standard (FHS). http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLOCKLOCKFILES -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Tue Apr 29 18:58:09 2008 From: scldad at sdc.com.au (Stephen Davies) Date: Wed, 30 Apr 2008 10:28:09 +0930 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <20080429193444.GU2928@elberon.bln.de.ingenico.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> Message-ID: <200804301028.09307.scldad@sdc.com.au> I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is the same. Any ideas as to how to handle this? Stephen On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: > * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: > > The biggest problem that I have seen with lockfiles on Linux > > At least is, that it seems there is no standard with respect > > To the folder in which they should be created. Also, many > > Distributions seem to set up file system permissions in such > > A way that writing to the lockfile folder is not allowed for > > The normal user -- that's why we stopped using lockfiles > > In our commercial product. > > It seems it depends on the expectations. I consider it as a > feature that by default a linux user cannot access serial ports. > Maybe root connected a modem (can produce phone bills) or even > some serial card reader, maybe with the web servers key pair. > > I would expect that by default a user cannot open the serial port > because of insufficient permissions on the device file. I would > expect this on other unices as well (but I don't know it). > > For windows I think it should be similar but not impacting so > much in practice, because often windows users work with big > permissions on a somewhat high priviledge level or even > Administrator. > > > If we are to still respect lockfiles, we first need to > > Understand where we are expected to look for them. Does > > Anybody have any insight what variants of lockfile folder > > Schema exist out there in the wild? Some apps like minicom > > Seem to even allow users to manually specify a lockfile > > Folder of their choice. > > At least my (ancient) minicom does not allow the user to change > this option, it is displayed but read-only, but root is allowed > to change it. > > > Because of the difficulty finding the right lockfile folder, > > And because of the inherent risk of thinking that something > > Might be locked while it actually isn't, I'd suggest that > > RXTX should have a "soft-off" feature that allows disabling > > ALL Lockfile checks at runtime without recompiling the native > > Sharedlibs. > > sounds very reasonable, yes... > and as admin I would not wish that users could skip such > locking because they do things wrong by default ;) > > (in the end I guess that is related to the dilemma, that > hotplug/user-owned-periphery and multi-user systems simply > conflict) > > > Trent - I like your strategy outline, but I think that it > > Needs to be configurable by the client such that users and/or > > Customer Support can disable lockfiles / disable ioctl in > > Case they detect that they are runing on an OS / Kernal that > > Does not support one or the other. > > Yes, this would be good I guess... Applications could offer > configuration options to control that, maybe similarily as > minicom. > > BTW, man minicom tells: > > *B - Lock file location > On most systems This should be /usr/spool/uucp. > Linux systems use /var/lock. If this directory > does not exist, minicom will not attempt to use > lockfiles. > > The statement `Linux systems use /var/lock' is interesting, does > anyone know the source of this convention? > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure > and expedient electronic transaction acceptance. Ingenico products leverage > proven technology, established standards and unparalleled ergonomics to > provide optimal reliability, versatility and usability. This comprehensive > range of products is complemented by a global array of services and > partnerships, enabling businesses in a number of vertical sectors to accept > transactions anywhere their business takes them. www.ingenico.com This > message may contain confidential and/or privileged information. If you are > not the addressee or authorized to receive this for the addressee, you must > not use, copy, disclose or take any action based on this message or any > information herein. If you have received this message in error, please > advise the sender immediately by reply e-mail and delete this message. > Thank you for your cooperation. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From tjarvi at qbang.org Wed Apr 30 19:30:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 30 Apr 2008 19:30:51 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <200804301028.09307.scldad@sdc.com.au> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> <460801A4097E3D4CA04CC64EE64858480584484C@ism-mail03.corp.ad.wrs.com> <20080429193444.GU2928@elberon.bln.de.ingenico.com> <200804301028.09307.scldad@sdc.com.au> Message-ID: Hi Stephen, I suspect ioctl/TIOCEXCL open/O_EXCL would do the job. Mac uses TIOCEXCL and it is POSIX. We use O_EXCL for lockfiles on Linux already. On Wed, 30 Apr 2008, Stephen Davies wrote: > I believe that only root can use the TIOCSLCKTRMIOS ioctl so the constraint is > the same. > > Any ideas as to how to handle this? > > Stephen > > > On Wednesday 30 April 2008 05:04, Steffen DETTMER wrote: >> * Oberhuber, Martin wrote on Tue, Apr 29, 2008 at 20:04 +0200: >>> The biggest problem that I have seen with lockfiles on Linux >>> At least is, that it seems there is no standard with respect >>> To the folder in which they should be created. Also, many >>> Distributions seem to set up file system permissions in such >>> A way that writing to the lockfile folder is not allowed for >>> The normal user -- that's why we stopped using lockfiles >>> In our commercial product. >> >> It seems it depends on the expectations. I consider it as a >> feature that by default a linux user cannot access serial ports. >> Maybe root connected a modem (can produce phone bills) or even >> some serial card reader, maybe with the web servers key pair. >> >> I would expect that by default a user cannot open the serial port >> because of insufficient permissions on the device file. I would >> expect this on other unices as well (but I don't know it). >> >> For windows I think it should be similar but not impacting so >> much in practice, because often windows users work with big >> permissions on a somewhat high priviledge level or even >> Administrator. >> >>> If we are to still respect lockfiles, we first need to >>> Understand where we are expected to look for them. Does >>> Anybody have any insight what variants of lockfile folder >>> Schema exist out there in the wild? Some apps like minicom >>> Seem to even allow users to manually specify a lockfile >>> Folder of their choice. >> >> At least my (ancient) minicom does not allow the user to change >> this option, it is displayed but read-only, but root is allowed >> to change it. >> >>> Because of the difficulty finding the right lockfile folder, >>> And because of the inherent risk of thinking that something >>> Might be locked while it actually isn't, I'd suggest that >>> RXTX should have a "soft-off" feature that allows disabling >>> ALL Lockfile checks at runtime without recompiling the native >>> Sharedlibs. >> >> sounds very reasonable, yes... >> and as admin I would not wish that users could skip such >> locking because they do things wrong by default ;) >> >> (in the end I guess that is related to the dilemma, that >> hotplug/user-owned-periphery and multi-user systems simply >> conflict) >> >>> Trent - I like your strategy outline, but I think that it >>> Needs to be configurable by the client such that users and/or >>> Customer Support can disable lockfiles / disable ioctl in >>> Case they detect that they are runing on an OS / Kernal that >>> Does not support one or the other. >> >> Yes, this would be good I guess... Applications could offer >> configuration options to control that, maybe similarily as >> minicom. >> >> BTW, man minicom tells: >> >> *B - Lock file location >> On most systems This should be /usr/spool/uucp. >> Linux systems use /var/lock. If this directory >> does not exist, minicom will not attempt to use >> lockfiles. >> >> The statement `Linux systems use /var/lock' is interesting, does >> anyone know the source of this convention? >> >> oki, >> >> Steffen >> >> About Ingenico Throughout the world businesses rely on Ingenico for secure >> and expedient electronic transaction acceptance. Ingenico products leverage >> proven technology, established standards and unparalleled ergonomics to >> provide optimal reliability, versatility and usability. This comprehensive >> range of products is complemented by a global array of services and >> partnerships, enabling businesses in a number of vertical sectors to accept >> transactions anywhere their business takes them. www.ingenico.com This >> message may contain confidential and/or privileged information. If you are >> not the addressee or authorized to receive this for the addressee, you must >> not use, copy, disclose or take any action based on this message or any >> information herein. If you have received this message in error, please >> advise the sender immediately by reply e-mail and delete this message. >> Thank you for your cooperation. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From yuan-hsin at imonitor.co.nz Tue Apr 1 16:14:06 2008 From: yuan-hsin at imonitor.co.nz (David Yuan-Hsin Huang) Date: Wed, 2 Apr 2008 11:14:06 +1300 Subject: [Rxtx] read() not blocking Message-ID: <6F78064EE0D1C8448847E2EF00C201AE0733BB@damail.internal.i-monitor.biz> Any word on the fix? I'm using the ugly workaround as well... Regards, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080402/635dd965/attachment-0077.html From wcteskey at gmail.com Thu Apr 3 09:47:12 2008 From: wcteskey at gmail.com (william teskey) Date: Thu, 3 Apr 2008 08:47:12 -0700 Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. Message-ID: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Hello List; I have spent a day trying to compile the source. I have managed not to get close. Probably did not get close to it right. Is there any binaries/jars that would work for me. I am willing to test. (submit bugs). William -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080403/7c194d69/attachment-0075.html From tjarvi at qbang.org Thu Apr 3 18:40:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 3 Apr 2008 18:40:57 -0600 (MDT) Subject: [Rxtx] Vista 64. How to get rxtxserial.dll and the jar. In-Reply-To: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> References: <84f51f7a0804030847q4d5a9121ofd98ef611e8d3f64@mail.gmail.com> Message-ID: On Thu, 3 Apr 2008, william teskey wrote: > Hello List; > > I have spent a day trying to compile the source. I have managed not to get > close. Probably did not get close to it right. Is there any binaries/jars > that > would work for me. I am willing to test. (submit bugs). Hi William The termios.c code for windows may not be 64 bit ready. In the past, I've not bothered looking at it because gcc didnt support the binary format. That has changed. I see mingw now has a 64 bit gcc now. I'll try compiling it and put something up. I imagine it is not going to work out of the box. I should have something (maybe a pile of gew) tomorrow night. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Fri Apr 4 09:27:48 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 04 Apr 2008 11:27:48 -0400 Subject: [Rxtx] intermittent serial port operation Message-ID: Hi All, I have a problem on an Intel Mac running MacOSX 10.5. When I try to use the serial port, I get: CommPortIdentifier:isCurrentlyOwned() CommPortIdentifier:addPortOwnershipListener() trying to open:/dev/cu.KeySerial1 CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) CommPortIdentifier:open(com1, 1000) RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) CommPortIdentifier:fireOwnershipEvent( 1 ) CommPortIdentifier:isCurrentlyOwned() dialString=atdt18006693900,,,,0,,154012413,,,6666 And no output is sent to the serial port. As if the port is presently owned. However, if I try a second time, it works OK. Any ideas what I could be doing wrong? Thanks! - Doug From greg.johnson at manchester.ac.uk Fri Apr 4 10:28:26 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Fri, 4 Apr 2008 18:28:26 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: Hi Doug, There was a bug that Martin Oberhuber fixed at one point on OSX that sounds similar (10.4 at the time) - but I don't know whether it is in the CVS repository or not. He and I had both experienced not being able to reuse a CommPortIdentifier (I think it was). Are you trying to open, close and reopen a port? If so, it is almost certainly this. Perhaps a snippet of code would help people diagnose more fully? Martin, did the fix you made go into the Eclipse plugins? Cheers, greg ------------------------------------------------------------------------- Greg Johnson Research Fellow at University of Manchester Scientific Collaborator at ESRF - European Synchrotron greg.johnson at esrf.fr greg.johnson at ieee.org +33 (0)4 76 88 28 37 On 4 Apr 2008, at 17:27, Dr. Douglas Lyon wrote: > Hi All, > I have a problem on an Intel Mac running MacOSX 10.5. > > When I try to use the serial port, I get: > CommPortIdentifier:isCurrentlyOwned() > CommPortIdentifier:addPortOwnershipListener() > trying to open:/dev/cu.KeySerial1 > CommPortIdentifier:getPortIdentifier(/dev/cu.KeySerial1) > CommPortIdentifier:open(com1, 1000) > RXTXCommDriver:getCommPort(/dev/cu.KeySerial1,1) > CommPortIdentifier:fireOwnershipEvent( 1 ) > CommPortIdentifier:isCurrentlyOwned() > dialString=atdt18006693900,,,,0,,154012413,,,6666 > > And no output is sent to the serial port. As if the port is > presently owned. However, if I try a second time, it works OK. > > Any ideas what I could be doing wrong? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From column.column at gmail.com Mon Apr 7 08:32:47 2008 From: column.column at gmail.com (column column) Date: Mon, 7 Apr 2008 17:32:47 +0300 Subject: [Rxtx] Cant read from com port in Debian linux Message-ID: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Hello, Trying to work with serial device using RXTXcomm in Debian linux. I can send data to device/other_pc. Unfortunately I can't read anything from it. No data available in port. The same code in Windows works correctly. What is the best way to start look for problem? Thank you From tjarvi at qbang.org Mon Apr 7 18:04:38 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 7 Apr 2008 18:04:38 -0600 (MDT) Subject: [Rxtx] Cant read from com port in Debian linux In-Reply-To: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> References: <3087355f0804070732x1a2cd6d5wa1c77f3d1037be42@mail.gmail.com> Message-ID: On Mon, 7 Apr 2008, column column wrote: > Hello, > > Trying to work with serial device using RXTXcomm in Debian linux. I > can send data to device/other_pc. Unfortunately I can't read anything > from it. No data available in port. > > > The same code in Windows works correctly. > > > What is the best way to start look for problem? > > Try seeing if there is another application reading the port. After exiting your program type the following: fuser /dev/ttyS0 (assuming thats the port) This will list the PID of any applications that have the port open. You can then identify the program with the ps command. -- Trent Jarvi tjarvi at qbang.org From sspies at sloc.de Tue Apr 8 08:03:12 2008 From: sspies at sloc.de (Sebastian Spies) Date: Tue, 08 Apr 2008 16:03:12 +0200 Subject: [Rxtx] rxtx on gumstix: Interrupted system call Message-ID: <47FB7B20.7080504@sloc.de> Hey, I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use RXTXPort$SerialInputStream.read(), then I get the following Exception. I did not yet figure out which system call is interrupted as strace produces loads of output. Any help would be very appreciated. Thanks in advance. Sebastian [java] java.io.IOException: Interrupted system call in readArray [java] at gnu.io.RXTXPort.readArray(Native Method) [java] at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) [java] at java.io.FilterInputStream.read(FilterInputStream.java:189) [java] at java.io.BufferedInputStream.refill(BufferedInputStream.java:371) [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:229) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) [java] at com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) [java] at com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) -- Sebastian Spies mail: sspies at sloc.de From Martin.Oberhuber at windriver.com Tue Apr 8 10:38:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 8 Apr 2008 18:38:27 +0200 Subject: [Rxtx] intermittent serial port operation In-Reply-To: References: Message-ID: <460801A4097E3D4CA04CC64EE6485848053744C1@ism-mail03.corp.ad.wrs.com> Yes, I did fix some issues in CommPortIdentifier and they should Be in CVS HEAD, and released to the RXTX Eclipse Plugin but Not yet an official RXTX release. Unfortuantely from the E-Mail I have no idea what this All is about. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Greg Johnson > Sent: Freitag, 04. April 2008 18:28 > To: Dr. Douglas Lyon > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] intermittent serial port operation > > Hi Doug, > There was a bug that Martin Oberhuber fixed at one point on OSX that > sounds similar (10.4 at the time) - but I don't know whether > it is in > the CVS repository or not. He and I had both experienced not being > able to reuse a CommPortIdentifier (I think it was). Are you trying > to open, close and reopen a port? If so, it is almost certainly this. > > Perhaps a snippet of code would help people diagnose more fully? > > Martin, did the fix you made go into the Eclipse plugins? > > Cheers, > greg From sveinung84 at users.sourceforge.net Wed Apr 9 08:41:26 2008 From: sveinung84 at users.sourceforge.net (Sveinung Kvilhaugsvik) Date: Wed, 9 Apr 2008 16:41:26 +0200 Subject: [Rxtx] Free software javax.comm? Message-ID: Hello Sorry about my English, it is not my native language. Is a 100% free (as in free market, not as in free beer) implementation of javax.comm available at the moment? (All I could find was RXTX + Sun's code) Have anybody talked to Sun about freeing the code that, if I understand http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make rxtx implement javax.comm? Have anyone talked to them about releasing it after they made their jvm free software ("open source")? If this is the wrong place to ask, where should I ask instead? -- Sincerly Sveinung Kvilhaugsvik From ajmas at sympatico.ca Wed Apr 9 19:00:01 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 9 Apr 2008 21:00:01 -0400 Subject: [Rxtx] Free software javax.comm? In-Reply-To: References: Message-ID: If you are talking about using the javax.comm package, then RxTx is you friend, except that branch doesn't get much attention these days. If you are looking for something that matches the API and does the same stuff, but uses the a different package then RxTx is definitely what you want. I recommend downloading Rxtx and testing it out. RxTX is essentily a javax.comm implementation, but uses the gnu.io package base instead. Andre On 9-Apr-08, at 10:41 , Sveinung Kvilhaugsvik wrote: > Hello > > Sorry about my English, it is not my native language. Is a 100% free > (as in free market, not as in free beer) implementation of javax.comm > available at the moment? (All I could find was RXTX + Sun's code) Have > anybody talked to Sun about freeing the code that, if I understand > http://www.geeksville.com/~kevinh/linuxcomm.html correctly, will make > rxtx implement javax.comm? Have anyone talked to them about releasing > it after they made their jvm free software ("open source")? If this is > the wrong place to ask, where should I ask instead? > > -- > Sincerly > Sveinung Kvilhaugsvik > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Apr 10 04:41:17 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 10 Apr 2008 06:41:17 -0400 Subject: [Rxtx] class vs. interface Message-ID: Hi All, Why should the SerialPort class be an abstract class instead of an interface? Aside from a legacy code rationale, is there a technical reason? Thanks! - Doug From ajmas at sympatico.ca Thu Apr 10 07:03:44 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 10 Apr 2008 09:03:44 -0400 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <3A81A092-48F1-42DF-84DF-5BB9AD075C47@sympatico.ca> On 10-Apr-08, at 06:41 , Dr. Douglas Lyon wrote: > Hi All, > Why should the SerialPort class be an abstract > class instead of an interface? > > Aside from a legacy code rationale, is there a technical > reason? One advantage I can imagine is that it would prevent a class trying to be both a SerialPort and a ParallelPort. Beyond that I am would have to think about that one. Andre From michael.erskine at ketech.com Thu Apr 10 07:30:55 2008 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 10 Apr 2008 14:30:55 +0100 Subject: [Rxtx] class vs. interface In-Reply-To: References: Message-ID: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> > Dr. Douglas Lyon wrote: > Why should the SerialPort class be an abstract > class instead of an interface? Because it does something! :) > Aside from a legacy code rationale, is there a technical > reason? It might just be the designers' style preferences in play here: TMTOWTDI ("there's more than one way to do it"). Regards, Michael Erskine. From sebastien.jean.rxtx at gmail.com Thu Apr 10 10:56:22 2008 From: sebastien.jean.rxtx at gmail.com (Sebastien Jean) Date: Thu, 10 Apr 2008 18:56:22 +0200 Subject: [Rxtx] class vs. interface In-Reply-To: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> References: <06BA3262D918014F9183B66425D5A8D425407DC459@no-sv-03.ketech.local> Message-ID: <82717BC8-CC27-48CB-8B98-791B85D59463@gmail.com> This class has been designed abstract because it embodies some behaviour that is shared by any implementation of a serial port. If it was designed as an interface, every concrete implementation should have to "paste" the same piece of code. Having an abstract class forbids complex (but sometimes useful) designs where a concrete implementation could benefit to inherit from another class (since multiple inheritance is not supported in Java) Usually, such a framework offers the two solutions : an interface and an default implementation as an abstract class. Baz. Le 10 avr. 08 ? 15:30, Michael Erskine a ?crit : >> Dr. Douglas Lyon wrote: > >> Why should the SerialPort class be an abstract >> class instead of an interface? > > Because it does something! :) > >> Aside from a legacy code rationale, is there a technical >> reason? > > It might just be the designers' style preferences in play here: > TMTOWTDI ("there's more than one way to do it"). > > Regards, > Michael Erskine. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ptitjes at free.fr Sun Apr 13 11:33:41 2008 From: ptitjes at free.fr (Didier Villevalois) Date: Sun, 13 Apr 2008 19:33:41 +0200 Subject: [Rxtx] [RXTX] Acessing parallel port Message-ID: <480243F5.8060704@free.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I'm currently investigating the use of RXTX to access IO ports for JPicProg (jpictools.sf.net) a PIC programmer software. It seems I can open and write to Serial ports without problem. But when I try to write to /dev/lp0 I get the following exception : Exception in thread "main" java.io.IOException: Resource temporarily unavailable in writeArray ~ at gnu.io.LPRPort.writeArray(Native Method) ~ at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) ~ at org.jpictools.prog.io.RXTXIOPortFactory.main(RXTXIOPortFactory.java:35) I think I have the correct permissions : # ls -l /dev/lp0 /dev/ttyS0 crwxrwxrwx 1 root lp 6, 0 Apr 13 13:14 /dev/lp0 crwxrwxrwx 1 root uucp 4, 64 Apr 13 13:58 /dev/ttyS0 Also, I did not find so much documentation about the use of RXTX. I need to access IO pins independently. As I understand it, I have to use the input and output streams. So for the parallel port, I have to send bytes which corresponds to the state of the D0-D7 pins. Did I understand correctly ? I do not see however how I have to do for the Serial ports. How do I set pins state ? Best regards, Didier. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIAkP0VE1mALQL3JsRAhS3AJ40JKvgYxluPfxQ/Y4IKnpUIw3ZnQCfTz4T IJgiWNB2Drz+WvmPabGBcvc= =VqoF -----END PGP SIGNATURE----- From tjarvi at qbang.org Sun Apr 13 12:41:54 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 Apr 2008 12:41:54 -0600 (MDT) Subject: [Rxtx] [RXTX] Acessing parallel port In-Reply-To: <480243F5.8060704@free.fr> References: <480243F5.8060704@free.fr> Message-ID: > I do not see however how I have to do for the Serial ports. How do I set > pins state ? > public abstract boolean isDTR(); public abstract void setDTR( boolean state ); public abstract void setRTS( boolean state ); public abstract boolean isCTS(); public abstract boolean isDSR(); public abstract boolean isCD(); public abstract boolean isRI(); public abstract boolean isRTS(); You can control DTR and RTS serial port pins in rxtx. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Apr 13 20:41:22 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 14 Apr 2008 12:41:22 +1000 Subject: [Rxtx] : RXTX-LEOPARD ETC Message-ID: Noel Goldsmith asked about problems with rxtx and leopard and G5. I have now extracted the CVS source from the net. For rxtx 1.8 I believe. Installed X-CODE 2.4 on a G5 iMac, with the SDK's I thought were necessary. Double clicked on the X-code project for rxtx. Selected the target as recommended. Selected build. And it did. With no errors and one warning about typecasting. I checked the targets and found it was set to intel and G5. I copied the two files so produced into the correct location of the quad G5 MacPro, (after installing Leopard 10.5, I still have to do the 10.5.2 update). I have also to check whether the addition of another user works. And I am pleased to report that the serial port now works on Leopard on a G5. I am using the Keyspan USB to serial 28x converter. So thank you to the helpful contributors to this list, in particular Andre-Jon Mas Now I have a binary which should work on PPC or intel, is there somewhere I could upload it to, so others could use it if they wished? Best wishes Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From wcteskey at gmail.com Wed Apr 16 08:13:04 2008 From: wcteskey at gmail.com (william teskey) Date: Wed, 16 Apr 2008 07:13:04 -0700 Subject: [Rxtx] Vista64: Message-ID: <001601c89fcb$fe1cd8e0$fa568aa0$@com> Hello List: I was wondering how attempts to port rxtx to the 64 bit windows operating system is coming. William No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date: 4/15/2008 6:10 PM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080416/3b5a6eff/attachment-0062.html From pboulton at pulsetracer.com Fri Apr 18 14:30:13 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Fri, 18 Apr 2008 13:30:13 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site Message-ID: <480904D5.1060307@pulsetracer.com> Hello, gentle serial porters. I have downloaded the zipped up binaries for use on Windows without Sun's CommAPI, but don't seem able to extract anything from the download. Go to main page, http://www.rxtx.org/ Click on Downloads I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) And I save it to disk. If I try and extract the files with WinZip, Winzip thinks the archive is corrupt. If I try using Windows Explorer, I am able to extract it into a single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than the original .zip. Any help would be much appreciated. Sincerely, Philip Boulton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080418/97d89793/attachment-0060.html From tjarvi at qbang.org Fri Apr 18 19:07:00 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 18 Apr 2008 19:07:00 -0600 (MDT) Subject: [Rxtx] Difficulty opening zip file at rxtx site In-Reply-To: <480904D5.1060307@pulsetracer.com> References: <480904D5.1060307@pulsetracer.com> Message-ID: On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org From pboulton at pulsetracer.com Sat Apr 19 12:46:26 2008 From: pboulton at pulsetracer.com (Philip Boulton) Date: Sat, 19 Apr 2008 11:46:26 -0700 Subject: [Rxtx] Difficulty opening zip file at rxtx site References: <480904D5.1060307@pulsetracer.com> Message-ID: <53DB7576450695419E09299104043761A78533@ZTGSERVER.ztg.local> I have been able to get my hands on the binaries, by going to the ftp directory /pub/rxtx at ftp.qbang.org,, and ftping the file rxtx-2.1-7-bins-r2.zip . This opens happily with Winzip, and extracts as the set of files that you describe below. I only experience the ill-formed archive problem by clicking the link on the rxtx.org Downloads page (http://rxtx.qbang.org/pub/rxtx/ rxtx-2.1-7-bins-r2.zip ). Not sure what to make of that. Philip Boulton ________________________________ From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Fri 4/18/2008 6:07 PM To: Philip Boulton Cc: rxtx at qbang.org Subject: Re: [Rxtx] Difficulty opening zip file at rxtx site On Fri, 18 Apr 2008, Philip Boulton wrote: > Hello, gentle serial porters. > > I have downloaded the zipped up binaries for use on Windows without Sun's > CommAPI, but don't seem able to extract anything from the download. > > Go to main page, http://www.rxtx.org/ > Click on Downloads > I'm trying to get RXTX 2.1 for use without Sun's CommAPI, so I double > click on the link labelled: rxtx-2.1-7-bins-r2.zip (Final) > > And I save it to disk. > > If I try and extract the files with WinZip, Winzip thinks the archive is > corrupt. If I try using Windows Explorer, I am able to extract it into a > single binary file called rxtx-2.1-7-bins-r2, which is slightly larger than > the original .zip. > Hi Philip, This is interesting as the file appears to be fine. I personally had problems with the file in an older Fedora Linux install. It turned out to be a bug in unzip. Upgrading fixed the problem. A few Linux users reported the same issue and upgrading worked for them. For over a year, no windows user complained. Several months later, I'm seeing the same type of report from windows users. Even though the file has not been changed, it is now a problem for windows? This feels like a bug propogating via a shared code base but I only have the above observations to support it. Weird. The md5sum for the file is: [tjarvi at qbang rxtx]$ md5sum rxtx-2.1-7-bins-r2.zip 5f21ae633602a24fd3cdd096951476c2 rxtx-2.1-7-bins-r2.zip [tjarvi at qbang rxtx]$ pwd /var/ftp/pub/rxtx [tjarvi at qbang rxtx]$ unzip -l rxtx-2.1-7-bins-r2.zip Archive: rxtx-2.1-7-bins-r2.zip Length Date Time Name -------- ---- ---- ---- 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/ 0 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ 0 01-31-06 01:05 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/ 60041 01-30-06 00:23 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxParallel.so 154682 02-01-06 13:00 rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:52 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/ 138573 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so 0 02-04-06 18:58 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/ 188377 02-04-06 18:59 rxtx-2.1-7-bins-r2/Linux/ia64-unkown-linux-gnu/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/ 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/ 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial-2.1-7.so 136880 01-31-06 00:26 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc32-sun-solaris2.8/librxtxSerial.so 0 01-31-06 00:51 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/ 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial-2.1-7.so 162720 01-31-06 00:43 rxtx-2.1-7-bins-r2/Solaris/sparc-solaris/sparc64-sun-solaris2.8/librxtxSerial.so 0 02-04-06 17:36 rxtx-2.1-7-bins-r2/Windows/ 0 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/ 47421 01-30-06 00:23 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxParallel.dll 77759 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/rxtxSerial.dll 102 03-01-06 12:01 rxtx-2.1-7-bins-r2/Windows/i368-mingw32/README 0 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/ 326432 03-01-06 12:04 rxtx-2.1-7-bins-r2/Mac_OS_X/librxtxSerial.jnilib 155 03-01-06 12:06 rxtx-2.1-7-bins-r2/Mac_OS_X/README 59464 01-30-06 00:23 rxtx-2.1-7-bins-r2/RXTXcomm.jar 1614 02-04-06 17:58 rxtx-2.1-7-bins-r2/INSTALL -------- ------- 1653820 27 files -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080419/147923bb/attachment-0059.html From jlar310 at gmail.com Sat Apr 19 19:11:55 2008 From: jlar310 at gmail.com (Jeff Larsen) Date: Sat, 19 Apr 2008 20:11:55 -0500 Subject: [Rxtx] Moxa serial over Ethernet driver Message-ID: Hi all, I've been using javax.comm for years to communicate with a legacy radio data system. We want to migrate the java side of the system to a VMware Server virtual machine. We've had great success using Moxa DE-303 and 5610 serial over Ethernet appliances and virtual machines for running hylafax. The OS (Linux in this case) uses a kernel driver to communicate with the Moxa via a virtual serial port such as /dev/ttyr00. I want to do the same thing with javax.comm or gnu.io to connect to a virtual serial port. However I'm hitting road blocks everywhere. javax.comm for Linux sees the virtual port, but there are transmission errors. Tried Solaris too, but the Solaris Moxa drivers don't play nice with javax.comm because the driver uses /dev/pts/n instead of /dev/term/x. Next I tried RXTX on Linux, but I'm getting NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX on Solaris. Has anyone used RXTX with serial over Ethernet devices? Any hints on how to make it work? I know that I'm not completely off track because javax.comm does work with Moxa on a Windows platform, but that's just not an option for production deployment. -- Jeff From tjarvi at qbang.org Sat Apr 19 21:08:41 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 19 Apr 2008 21:08:41 -0600 (MDT) Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: yOn Sat, 19 Apr 2008, Jeff Larsen wrote: > Hi all, > > I've been using javax.comm for years to communicate with a legacy > radio data system. We want to migrate the java side of the system to a > VMware Server virtual machine. We've had great success using Moxa > DE-303 and 5610 serial over Ethernet appliances and virtual machines > for running hylafax. The OS (Linux in this case) uses a kernel driver > to communicate with the Moxa via a virtual serial port such as > /dev/ttyr00. > > I want to do the same thing with javax.comm or gnu.io to connect to a > virtual serial port. However I'm hitting road blocks everywhere. > javax.comm for Linux sees the virtual port, but there are transmission > errors. Tried Solaris too, but the Solaris Moxa drivers don't play > nice with javax.comm because the driver uses /dev/pts/n instead of > /dev/term/x. Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris. > > Has anyone used RXTX with serial over Ethernet devices? Any hints on > how to make it work? > > I know that I'm not completely off track because javax.comm does work > with Moxa on a Windows platform, but that's just not an option for > production deployment. > > Moxa should work under linux. There may be minor issues depending upon how complete the kernel driver is but I think it will work. One of the minor issues is /dev/ttyr00 is not enumerated. There are several work arounds documented with the source code and on the wiki. The easiest solution for testing purposes is to make a symbolic link from /dev/ttyr00 to a port that is enumerated such as /dev/ttyS129. You can later alter the rxtx source or use properties to change the enumerated ports. -- Trent Jarvi tjarvi at qbang.org From d.tonhofer at m-plify.com Sun Apr 20 03:33:30 2008 From: d.tonhofer at m-plify.com (David Tonhofer (M-PLIFY S.A.)) Date: Sun, 20 Apr 2008 11:33:30 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: References: Message-ID: <480B0DEA.5010908@m-plify.com> Jeff Larsen wrote: > Next I tried RXTX on Linux, but I'm getting > NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX > on Solaris It might be that the Java side of RXTX does not recognize that portname. Trying modifying src/RXTXCommDriver.java as described in this case: http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card From ajmas at sympatico.ca Sun Apr 20 16:37:59 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 20 Apr 2008 18:37:59 -0400 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <480B0DEA.5010908@m-plify.com> References: <480B0DEA.5010908@m-plify.com> Message-ID: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > Jeff Larsen wrote: >> Next I tried RXTX on Linux, but I'm getting >> NoSuchPortException connecting to /dev/ttyr00. I have yet to try RXTX >> on Solaris > It might be that the Java side of RXTX does not recognize that > portname. > Trying modifying src/RXTXCommDriver.java as described in this case: > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_SST-4P.2FLP_multiport_card I wonder whether it would be worth allowing custom port prefixes as a system parameter? For example: gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" Andre From Martin.Oberhuber at windriver.com Tue Apr 22 12:34:36 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 22 Apr 2008 20:34:36 +0200 Subject: [Rxtx] Moxa serial over Ethernet driver In-Reply-To: <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> References: <480B0DEA.5010908@m-plify.com> <0F262A9B-5D5C-4E32-9D4E-C7362C791FC9@sympatico.ca> Message-ID: <460801A4097E3D4CA04CC64EE6485848056CD6CE@ism-mail03.corp.ad.wrs.com> Sounds like a great idea... I'm wondering how the "variable part" after the Prefixes could be specified though? What about allowing Regular Expression character Classes in the existing System Property for specifying ports: System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyS[0-9],ttyS[ABC],ttyUSB[0-9a-z]"); The set of allowed patterns would of course need to Be restricted compared to REGEX, because it must be A syntax that supports iterating over it. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Montag, 21. April 2008 00:38 > To: rxtx at qbang.org and Users > Subject: Re: [Rxtx] Moxa serial over Ethernet driver > > > On 20-Apr-08, at 05:33 , David Tonhofer (M-PLIFY S.A.) wrote: > > Jeff Larsen wrote: > >> Next I tried RXTX on Linux, but I'm getting > >> NoSuchPortException connecting to /dev/ttyr00. I have yet > to try RXTX > >> on Solaris > > It might be that the Java side of RXTX does not recognize that > > portname. > > Trying modifying src/RXTXCommDriver.java as described in this case: > > > > > http://rxtx.qbang.org/wiki/index.php/FAQ#RXTX_and_the_Equinox_ > SST-4P.2FLP_multiport_card > > I wonder whether it would be worth allowing custom port > prefixes as a > system parameter? For > example: > > gnu.io.port.prefixes="ttyS,ttySA,ttyUSB" > > Andre > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Loi.TRAN at weatherford.com Tue Apr 22 13:10:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Tue, 22 Apr 2008 14:10:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled Message-ID: Hi, I'm currently using the Java RXTX API to interface to a serial port. The serial port is connected to a bridge board that communicates with our communications system running at 1.875 Mbps which is linked to an embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no flow control). I send a command to the embedded board through the serial-bridge board which then is relayed to the embedded board. The command sent asks the embedded board to dump a binary image. Here's where I'm hitting some problems. I've successfully done this is an integrated serial port from the laptop. The binary file that comes back is consistent on every attempt. When I use the application I've written to do the same thing with a USB-to-serial adapter, the image I get back is not the same as the image I receive through the USB-to-serial adapter is not consistent at all. A final thing is that when I use a terminal program to dump the binary image with the USB-serial adapter, the image is correct. Every time! What is the terminal program doing that's not being done in my application? My application is quite simple. Has anyone observed this behavior before? If you have, I'd like to know how you've gotten around this problem. Thanks, LT =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From tjarvi at qbang.org Tue Apr 22 21:11:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 22 Apr 2008 21:11:10 -0600 (MDT) Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org From Loi.TRAN at weatherford.com Wed Apr 23 08:35:58 2008 From: Loi.TRAN at weatherford.com (TRAN, Loi X.) Date: Wed, 23 Apr 2008 09:35:58 -0500 Subject: [Rxtx] Prolific USB - RXTX data mangled In-Reply-To: References: Message-ID: Thanks for all the responses. I finally tried something that worked consistently. I updated my Prolific driver and repeated my tests. It worked. If you're using the Prolific type USB-serial adapters, do no use the Prolific version 2.0.2.1 driver on Windows. Update it to the latest 2.0.2.8 version. Again, thanks for all the responses. LT -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Tuesday, April 22, 2008 10:11 PM To: TRAN, Loi X. Cc: rxtx at qbang.org Subject: Re: [Rxtx] Prolific USB - RXTX data mangled On Tue, 22 Apr 2008, TRAN, Loi X. wrote: > Hi, > > I'm currently using the Java RXTX API to interface to a serial port. > The serial port is connected to a bridge board that communicates with > our communications system running at 1.875 Mbps which is linked to an > embedded board. The serial port is set to run at 57.6 Kbps (8,N,1, no > flow control). I send a command to the embedded board through the > serial-bridge board which then is relayed to the embedded board. The > command sent asks the embedded board to dump a binary image. > > Here's where I'm hitting some problems. I've successfully done this is > an integrated serial port from the laptop. The binary file that comes > back is consistent on every attempt. When I use the application I've > written to do the same thing with a USB-to-serial adapter, the image I > get back is not the same as the image I receive through the > USB-to-serial adapter is not consistent at all. > > A final thing is that when I use a terminal program to dump the binary > image with the USB-serial adapter, the image is correct. Every time! > What is the terminal program doing that's not being done in my > application? My application is quite simple. > > Has anyone observed this behavior before? If you have, I'd like to know > how you've gotten around this problem. > > Thanks, > Hi Loi It may be hardware buffer overruns. Hardware flow control would be a big help if so. You may try to find anyplace that may be sitting between reads. -- Trent Jarvi tjarvi at qbang.org =============================== CONFIDENTIAL & PRIVILEGED COMMUNICATION The information contained in this message is privileged, confidential, and protected from disclosure. This message is intended for the individual or entity addressed herein. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message, and then delete it from your system. The sender totally disclaims, and will not accept, any responsibility or liability for the unauthorized use, or the consequences of any unauthorized use, of this communication or message. From Martin.Oberhuber at windriver.com Wed Apr 23 18:54:26 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 02:54:26 +0200 Subject: [Rxtx] RXTX port locking on Linux status? Message-ID: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Dear RXTX community, I'm wondering what the status is with RXTX locking serial ports on Linux? My understanding is that the mechanism used in 2.1-7r2 (lockfiles) is not really state of the art, and has lots of problems (e.g. missing permissions). There was an idea to migrate towards a Kernel syscall based solution for port locking. What's the status here? Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/9878db9f/attachment-0055.html From tjarvi at qbang.org Wed Apr 23 20:32:24 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 23 Apr 2008 20:32:24 -0600 (MDT) Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > Dear RXTX community, > > I'm wondering what the status is with RXTX locking > serial ports on Linux? > > My understanding is that the mechanism used in > 2.1-7r2 (lockfiles) is not really state of the art, and > has lots of problems (e.g. missing permissions). > > There was an idea to migrate towards a Kernel > syscall based solution for port locking. > > What's the status here? > Hi Martin, I'm in favor of deprecating the current FHS locking mechanism in favor of an IOCTL when available. I think it will be available on all the platforms but do not know for sure. The status is unchanged. I've had very few free cycles for such things. Feel free to take a stab at it if you have some time. I believe the IOCTL is used in the Mac OS X code already. I don't see any real backwards compatability issues and the IOCTL should just work. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Apr 24 06:14:06 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 24 Apr 2008 14:14:06 +0200 Subject: [Rxtx] RXTX port locking on Linux status? In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848056CDF5B@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE64858480577CE32@ism-mail03.corp.ad.wrs.com> Thanks Trent. Problem is only that I'm really not at all Familiar with the C part of RXTX. If there Were anything I could do in Java for this, It would be easier for me.... ... Are there any C experts here on the list Who'd like to look at ioctl port locking For linux? Thanks, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Trent Jarvi [mailto:tjarvi at qbang.org] > Sent: Donnerstag, 24. April 2008 04:32 > To: Oberhuber, Martin > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] RXTX port locking on Linux status? > > On Thu, 24 Apr 2008, Oberhuber, Martin wrote: > > > Dear RXTX community, > > > > I'm wondering what the status is with RXTX locking > > serial ports on Linux? > > > > My understanding is that the mechanism used in > > 2.1-7r2 (lockfiles) is not really state of the art, and > > has lots of problems (e.g. missing permissions). > > > > There was an idea to migrate towards a Kernel > > syscall based solution for port locking. > > > > What's the status here? > > > > Hi Martin, > > I'm in favor of deprecating the current FHS locking mechanism > in favor of > an IOCTL when available. I think it will be available on all the > platforms but do not know for sure. > > The status is unchanged. I've had very few free cycles for > such things. > Feel free to take a stab at it if you have some time. I > believe the IOCTL > is used in the Mac OS X code already. > > I don't see any real backwards compatability issues and the > IOCTL should > just work. > > -- > Trent Jarvi > tjarvi at qbang.org > From sspies at sloc.de Thu Apr 24 07:15:36 2008 From: sspies at sloc.de (Sebastian Spies) Date: Thu, 24 Apr 2008 15:15:36 +0200 (CEST) Subject: [Rxtx] rxtx on gumstix: Interrupted system call In-Reply-To: <47FB7B20.7080504@sloc.de> References: <47FB7B20.7080504@sloc.de> Message-ID: <55445.130.83.139.205.1209042936.squirrel@ssl.sloc.de> Dear list, while porting rxtx to the gumstix, I found out, that select used in readArray in SerialImp.c might not work as expected. Maybe, because of missing TIOCSERGETLSR-support? select is often interrupted, so i wrote the following quick'n'dirty hack to make it work on gumstix: diff -Nur rxtx-2.1-7r2/src/SerialImp.c rxtx-2.1-7r2/src/SerialImp.c --- rxtx-2.1-7r2/src/SerialImp.c 2006-01-29 23:19:04.000000000 +0100 +++ rxtx-2.1-7r2-patched/src/SerialImp.c 2008-04-24 14:30:17.000000000 +0200 @@ -3380,7 +3381,7 @@ JNIEXPORT jint JNICALL RXTXPort(readArray)( JNIEnv *env, jobject jobj, jbyteArray jbarray, jint offset, jint length ) { - int bytes; + int bytes = 0; jbyte *body; /* char msg[80]; */ int fd = get_java_var( env, jobj, "fd", "I" ); @@ -3397,9 +3398,18 @@ "readArray", "Invalid length" ); return -1; } - body = (*env)->GetByteArrayElements( env, jbarray, 0 ); - bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ - (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + while(1 > bytes) + { + body = (*env)->GetByteArrayElements( env, jbarray, 0 ); + bytes = read_byte_array( env, &jobj, fd, (unsigned char *)(body+offset), length, timeout );/* dima */ + (*env)->ReleaseByteArrayElements( env, jbarray, body, 0 ); + + // quick'n'dirty - SSP + report (" trying again... \n"); + errno = 0; + } + if( bytes < 0 ) { report( "RXTXPort:readArray bytes < 0" ); LEAVE( "RXTXPort:readArray" ); > Hey, > > I have cross-compiled rxtx for arm-linux on a gumstix+uClib but if I use > RXTXPort$SerialInputStream.read(), then I get the following Exception. I > did not yet figure out which system call is interrupted as strace > produces loads of output. > > Any help would be very appreciated. Thanks in advance. > Sebastian > > > [java] java.io.IOException: Interrupted system call in readArray > [java] at gnu.io.RXTXPort.readArray(Native Method) > [java] at > gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1398) > [java] at > java.io.FilterInputStream.read(FilterInputStream.java:189) > [java] at > java.io.BufferedInputStream.refill(BufferedInputStream.java:371) > [java] at > java.io.BufferedInputStream.read(BufferedInputStream.java:229) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.readByte(HostSerialPipe.java:82) > [java] at > com.sun.spot.peripheral.radio.HostSerialPipe.receive(HostSerialPipe.java:57) > [java] at > com.sun.spot.peripheral.radio.ProxyMACCommandExecutor.run(ProxyMACCommandExecutor.java:61) > > -- > Sebastian Spies > > mail: sspies at sloc.de > > > > From fire_baptized at hotmail.com Thu Apr 24 18:27:48 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Thu, 24 Apr 2008 20:27:48 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Hello I am having a problem with the serial device connecting (software wise) to the serial port. However I have a test program and it seems to work just fine in that environment - and it doesnt use GUI. The error I am getting is : PortNotFoundException Now the way I have it setup in the GUI environment is that once the user pushes a JButton the program connects using this class: protected void establishConnection() { try { portId = CommPortIdentifier.getPortIdentifier("COM3"); System.out.println("Establishing connction....."); messages[0] = "\nEstablishing connction.....\n"; } catch ( NoSuchPortException noport) { System.out.println("Port not found: "+ noport); messages[0] = "Port not found: "+ noport+"\n"; } try { serialPort = (SerialPort) portId.open("serial", 50); System.out.println("Port has been found."); messages[1] = "Port has been found.\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[1] = "" +usedport; } try { serialPort = (SerialPort) portId.open("serial", 50); messages[2] = "Connecting to COM3 on port 50....\n"; } catch (PortInUseException usedport ) { System.out.println(usedport); messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; } try { serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); System.out.println("Esablishing the transfer rate settings for COM3."); messages[3] = "Esablishing the transfer rate settings for COM3.\n"; } catch (UnsupportedCommOperationException nosupcom) { System.out.println(nosupcom); System.out.println("The tranfer rate could not be esblished on COM3."); messages[3] = "The tranfer rate could not be esblished on COM3.\n"; } System.out.println(serialPort.getFlowControlMode()); messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; //sendDataOut(buffer[3],buffer[4]); } I need all the data in this method (and all the string values in this method) to be printed out on a JTextArea. I wont do me any good if not all the text is printed on a JTextArea in another class. So I have the text printing the JTextArea correctly, but everytime the JButton is activated - it gives me that error message. I did add a disconnect button that is supposed to call the serialPort.close(). _________________________________________________________________ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080424/273fd4ec/attachment-0054.html From tjarvi at qbang.org Thu Apr 24 21:54:10 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 24 Apr 2008 21:54:10 -0600 (MDT) Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > Hello I am having a problem with the serial device connecting (software > wise) to the serial port. However I have a test program and it seems to > work just fine in that environment - and it doesnt use GUI. The error I > am getting is : PortNotFoundException Now the way I have it setup in the > GUI environment is that once the user pushes a JButton the program > connects using this class: > > protected void establishConnection() { > try { > portId = CommPortIdentifier.getPortIdentifier("COM3"); > System.out.println("Establishing connction....."); > messages[0] = "\nEstablishing connction.....\n"; > } > catch ( NoSuchPortException noport) { > System.out.println("Port not found: "+ noport); > messages[0] = "Port not found: "+ noport+"\n"; > } > try { > serialPort = (SerialPort) portId.open("serial", 50); > System.out.println("Port has been found."); > messages[1] = "Port has been found.\n"; > } > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[1] = "" +usedport; > } ================================================================= > try { > serialPort = (SerialPort) portId.open("serial", 50); > messages[2] = "Connecting to COM3 on port 50....\n"; > } ================================================================== > catch (PortInUseException usedport ) { > System.out.println(usedport); > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > } > try { > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > System.out.println("Esablishing the transfer rate settings for COM3."); > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > } > catch (UnsupportedCommOperationException nosupcom) { > System.out.println(nosupcom); > System.out.println("The tranfer rate could not be esblished on COM3."); > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > } > System.out.println(serialPort.getFlowControlMode()); > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > //sendDataOut(buffer[3],buffer[4]); > } > > I need all the data in this method (and all the string values in this > method) to be printed out on a JTextArea. I wont do me any good if not > all the text is printed on a JTextArea in another class. So I have the > text printing the JTextArea correctly, but everytime the JButton is > activated - it gives me that error message. I did add a disconnect > button that is supposed to call the serialPort.close(). > The open code used twice is going to throw an exception. It may be that you catch the exception above this code and print a confusing message? A common mistake is people will accidently run two copies of their program. The first instance of the program will open the port and prevent enumeration (finding the port) in the second instance of the program. As an example, you may be running your text based application which is preventing the GUI from seeing the port. Enumeration is done by trying to open the port. If the port is open, Enumeration fails. -- Trent Jarvi tjarvi at qbang.org From fire_baptized at hotmail.com Thu Apr 24 22:32:05 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 00:32:05 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: Message-ID: Wow - thanks dude what a dumb thing for me to not catch..... now here is the current problem - right now I am trying to output data again one is with the test program - and it seems that serialPort.setRTS(true); is throwing an exceptions there - now if I show this code please bare in mind that I am only testing - the code is kinda sloppy in my mind - but if I can figure out why calling this function is throwing an exception then maybe I can figure out why my GUI application is getting the same null pointer exceptions when try to send out the data stream. FYI Trent this email is not directed towards you - anyone can jump in on this public static void main(String args[]) { byte[] b = new byte[64]; int keyinput = 0 ; byte x = 0; byte y = 0; PortTesting1 testports = new PortTesting1(); try { joyskoro = Joystick.createInstance(); } catch (IOException ioexc) { System.out.println("There is an input/output problem: " + ioexc); } while (true) { joyskoro.poll(); b[0] = ((byte) -(10 * joyskoro.getY())); b[1] = ((byte) (10 * joyskoro.getX())); System.out.println("The 3rd byte is: " +b[0]); System.out.println("The 4rd byte is: " +b[1]); serialPort.setRTS(true); // HERE IS WHERE THE PROBLEM IS !!!!!!! ON THIS LINE but if I dont have it active in my program the Bluetooth device (that is System.out.println("Ready to send :-) !"); //connected to the serial port does not send out data!!!!! if (joyskoro.isButtonDown(joyskoro.BUTTON10)) { System.out.println("Connection terminated."); serialPort.close(); break; } if (joyskoro.isButtonDown(joyskoro.BUTTON2)) { boolean flag = true; //reading from key input from the keyboard System.out.println("Please input a command: "); while (flag) { try { keyinput = System.in.read(); } catch (IOException ioexc) {/*there is no need to put * anything here */ } if((char)keyinput=='w') { pushIt((byte)85); } if((char)keyinput=='s') { pushIt((byte)84); } if((char)keyinput=='a') { pushIt((byte)83); } if((char)keyinput=='d') { pushIt((byte)82); } if((char)keyinput=='q') { pushIt((byte)89); } if((char)keyinput=='\t') { //this stop reading input from the keyboard flag = false; } } and help anyways here is the block of code that throwing an exception for the test program: > Date: Thu, 24 Apr 2008 21:54:10 -0600 > From: tjarvi at qbang.org > To: fire_baptized at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Serial Problems with Gui..... > > On Thu, 24 Apr 2008, Jesrael D. Summerhill wrote: > > > Hello I am having a problem with the serial device connecting (software > > wise) to the serial port. However I have a test program and it seems to > > work just fine in that environment - and it doesnt use GUI. The error I > > am getting is : PortNotFoundException Now the way I have it setup in the > > GUI environment is that once the user pushes a JButton the program > > connects using this class: > > > > protected void establishConnection() { > > try { > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > > System.out.println("Establishing connction....."); > > messages[0] = "\nEstablishing connction.....\n"; > > } > > catch ( NoSuchPortException noport) { > > System.out.println("Port not found: "+ noport); > > messages[0] = "Port not found: "+ noport+"\n"; > > } > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > System.out.println("Port has been found."); > > messages[1] = "Port has been found.\n"; > > } > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[1] = "" +usedport; > > } > ================================================================= > > try { > > serialPort = (SerialPort) portId.open("serial", 50); > > messages[2] = "Connecting to COM3 on port 50....\n"; > > } > ================================================================== > > catch (PortInUseException usedport ) { > > System.out.println(usedport); > > messages[2] = "COM3 is already in use on port 50: "+usedport+"\n"; > > } > > try { > > serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, > > SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); > > System.out.println("Esablishing the transfer rate settings for COM3."); > > messages[3] = "Esablishing the transfer rate settings for COM3.\n"; > > } > > catch (UnsupportedCommOperationException nosupcom) { > > System.out.println(nosupcom); > > System.out.println("The tranfer rate could not be esblished on COM3."); > > messages[3] = "The tranfer rate could not be esblished on COM3.\n"; > > } > > System.out.println(serialPort.getFlowControlMode()); > > messages[4] = "Establishing connection types: " + serialPort.getFlowControlMode()+"\n"; > > > > System.out.println("The serial port having DTR capibility is: " + serialPort.isDTR()); > > messages[5] = "The serial port having DTR capibility is: " + serialPort.isDTR() +"\n"; > > System.out.println("The serial port having CTS capibility is: " + serialPort.isCTS()); > > messages[6] = "The serial port having CTS capibility is: " + serialPort.isCTS()+"\n"; > > System.out.println("The serial port having RTS capibility is: " + serialPort.isRTS()); > > messages[7] = "The serial port having RTS capibility is: " + serialPort.isRTS()+"\n"; > > System.out.println("The serial port having DSR capibility is: " + serialPort.isDSR()); > > messages[8] = "The serial port having DSR capibility is: " + serialPort.isDSR()+"\n"; > > System.out.println("The serial port having CD capibility is: " + serialPort.isCD()); > > messages[9] = "The serial port having CD capibility is: " + serialPort.isCD()+"\n"; > > > > //sendDataOut(buffer[3],buffer[4]); > > } > > > > I need all the data in this method (and all the string values in this > > method) to be printed out on a JTextArea. I wont do me any good if not > > all the text is printed on a JTextArea in another class. So I have the > > text printing the JTextArea correctly, but everytime the JButton is > > activated - it gives me that error message. I did add a disconnect > > button that is supposed to call the serialPort.close(). > > > > The open code used twice is going to throw an exception. It may be that > you catch the exception above this code and print a confusing message? > > A common mistake is people will accidently run two copies of their > program. The first instance of the program will open the port and prevent > enumeration (finding the port) in the second instance of the program. > > As an example, you may be running your text based application which is > preventing the GUI from seeing the port. Enumeration is done by trying to > open the port. If the port is open, Enumeration fails. > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080425/5c8f7d68/attachment-0054.html From fire_baptized at hotmail.com Fri Apr 25 07:59:53 2008 From: fire_baptized at hotmail.com (Jesrael D. Summerhill) Date: Fri, 25 Apr 2008 09:59:53 -0400 Subject: [Rxtx] Serial Problems with Gui..... In-Reply-To: References: